Android OutOfMemoryError in SetContentView line

后端 未结 4 1740
心在旅途
心在旅途 2020-12-21 05:51

When i try to open my chat class , sometimes it runs properly , sometimes it gives OutOfMemoryError at setContentView line.I can\'t understand what is the cause of problem?

4条回答
  •  情书的邮戳
    2020-12-21 06:39

    A few things to look at.

    Have you provided the background image(s) for several densities? Scaling is sometimes consuming a lot of memory.

    Do you use startActivity or startActivityForResult()? In the latter case, your older Activity objects cannot be destroyed.

    Do you collect information in the Application class?

提交回复
热议问题