0

I searched on the internet but didn't get a solution. How do I get a Bitmap of a Large size image(13 Mb) from the path of an image in the SD card or phone memory?

I use this:

Bitmap b = BitmapFactory.decodeFile(path);

and get an exception on this line

Thanks.

Zach H
  • 257
  • 1
  • 3
  • 15

2 Answers2

1

This has to do with the Java Heap Size.

You can request a larger heap using the manifest on devices that are 2.3 or above.

See this Stack Overflow post for more information.

Community
  • 1
  • 1
0

Use android:largeHeap="true" for solve this:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher"
    android:largeHeap="true"
Nam ND
  • 1