Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid display multiple images from Gallery
    primarykey
    data
    text
    <p>I am trying to display multiple images from Gallery. For that I am using <a href="https://github.com/luminousman/MultipleImagePick" rel="nofollow">MultipleImagePick</a> library to select multiple images from Gallery. My problem is, when displaying the selected images in image view, am getting java.lang.OutOfMemoryError </p> <p>Here is the log</p> <pre><code>11-07 15:20:23.035: E/AndroidRuntime(2679): FATAL EXCEPTION: main 11-07 15:20:23.035: E/AndroidRuntime(2679): java.lang.OutOfMemoryError 11-07 15:20:23.035: E/AndroidRuntime(2679): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 11-07 15:20:23.035: E/AndroidRuntime(2679): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:650) 11-07 15:20:23.035: E/AndroidRuntime(2679): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:389) 11-07 15:20:23.035: E/AndroidRuntime(2679): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:449) </code></pre> <p>I am using below code to display image in imageView </p> <pre><code> Bitmap bitmapOriginal = null; Bitmap bitmapsimplesize = null; ImageView imageView; File imageFile; for (String string : all_path) { imageView = new ImageView(this); imageFile = new File(string); if(imageFile.exists()){ bitmapOriginal = BitmapFactory.decodeFile(imageFile.getAbsolutePath()); bitmapsimplesize = Bitmap.createScaledBitmap(bitmapOriginal,200, 200, true); bitmapOriginal.recycle(); imageView.setPadding(10, 10, 10, 10); imageView.setImageBitmap(bitmapsimplesize); } else { Log.d("@@##", "image not exist"); } imageHoler.addView(imageView); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload