0

i am developing kids 1 to 100 learning number speaching application. here i used nearly 100 images used to refer the every images.

i have two two levels. dynamically creating buttons, runtimely load images into buttons here. one is for number showing with images level. another one is for alphabetic with images showing level. totally i used 150 images from drawable folder.all images are PNG format with width and height is nearly each one 240 into 210 like that..

when i click NUMBERS level button , that part working fine. when i get back second alphabetic level its completely application crashed. Error is: Out of Memory error only..

I refered this stack link : Strange out of memory issue while loading an image to a Bitmap object

they told like, get the image and decode and load it into drawable. here exactly i dont know , how to get image from drawable and load into bitmap and decode the image and set into dynamic button..

note: here i dynamically created 100 buttons using for loop, that time, i need to load images. i created successfully everything. when i run the program, i am getting memory error.

please help me solve this issue..

Community
  • 1
  • 1
harikrishnan
  • 1,985
  • 4
  • 32
  • 63

1 Answers1

0

I Solved this problem using android:largeHeap="true" in application tag in AndroidManifest.xml