Posts

Showing posts with the label Android Bitmap

Android:java.lang.OutOfMemoryError: Failed To Allocate A 23970828 Byte Allocation With 2097152 Free Bytes And 2MB Until OOM

Answer : OutOfMemoryError is the most common problem that occurs in android while especially dealing with bitmaps. This error is thrown by the Java Virtual Machine (JVM) when an object cannot be allocated due to lack of memory space and also, the garbage collector cannot free some space. As mentioned by Aleksey, you can add the below entities in your manifest file android:hardwareAccelerated="false" , android:largeHeap="true" it will work for some environments. <application android:allowBackup="true" android:hardwareAccelerated="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:supportsRtl="true" android:theme="@style/AppTheme"> you should definitely read some of Androids Developer concept's, especially here:Displaying Bitmaps Efficiently Read all 5 topics and rewrite your code again. If it st...