Skip to content Skip to sidebar Skip to footer

Android Outofmemory Issue

i face outofmemory issue in my app and after some search, I found out this code //decodes image and scales it to reduce memory consumption private Bitmap decodeFile(File f){

Solution 1:

but IDK how to use it

Then I guess you haven't implemented it! Well, that method will convert a file of yours (saved at SD card, eg) to a resized Bitmap wich can be used as background of an ImageView.

Now, answering to your question, you can use it as I show you below:

Bitmapbitmap= decodeFile(newFile(your_string_file_path));
myImageView.setImageBitmap(bitmap);

That's all you have to know, I guess.

Post a Comment for "Android Outofmemory Issue"