Android OutOfMemoryError in SetContentView line

后端 未结 4 1729
心在旅途
心在旅途 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:44

    Increase the gradle.properties in the root of your project :

    org.gradle.jvmargs=-XX:MaxHeapSize\=512m -Xmx512m

    the default jvmargs is 256

    you can request to use more by using.

    android:largeHeap="true"
    

    in the manifest.xml.

提交回复
热议问题