Tengo este código:
if(imgFile.exists()) {
BitmapFactory.Options btOptions = new BitmapFactory.Options();
btOptions.inJustDecodeBounds = true;
btOptions.inSampleSize = 8;
Log.e("IMAGEN ERROR", imgFile.getAbsolutePath());
//Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
//final BitmapFactory.Options options = new BitmapFactory.Options();
//options.inSampleSize = 8;
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
if (myBitmap != null) {
int imgHeight = myBitmap.getHeight();
int imgWidth = myBitmap.getWidth();
ImageView myImage = holder.image;
myImage.setImageBitmap(myBitmap);
}
}
Me da este error:
java.lang.OutOfMemoryError: Failed to allocate a 552960012 byte allocation with 4193416 free bytes and 418MB until OOM
El error me lo da aqui:
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
Creo que la imagen pesa alrededor de 18mb