Click here to Skip to main content
12,395,946 members (67,539 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Java Mobile Android
I have images stored on sd card(size of each ~ 4MB). I want to resize it, than set it to ImageView. But I cannot do it using
BitmapFactory.decodeFile(path)
becouse Exception
java.lang.OutOfMemoryError
is appeared. How can i resize image without loading it in the memory. Is it real?
Posted 6-Aug-12 5:14am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Try adding android:largeHeap="true" to your application tag in AndroidManifest.xml and see if that helps (it should let you use more memory), and make sure you release the large version of the file when you're done so the garbage collector can reclaim the memory.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 6 Aug 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100