When you try to load large size images in image editor in Android, you may get out of memory exception because this application cannot handle large size images. You can resolve this exception by using the following two ways:
Methods to resolve out of memory exception
1. Set largeHeap value as true in Android project.
2. Set largeHeap size for application.
How to set largeHeap value as true in Android project?
To set largeHeap value as true in Android project, refer the following code snippet.
To set largeHeap value as true, refer the following steps:
Step 1: Expand properties tab in Android project.
Step 2: In AndroidManifest.xml file, set largeHeap value as true. Please refer the following screenshot for better understanding.
How to set largeHeap size in application?
To set largeHeap size in application, follow the below steps:
Step 1: Right-click the Android project, and then select Properties.
Step 2: In Android options, select Advance and set Java Max Heap size as 1G.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|