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?
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.