Hi,
When I am trying to load even a image of 4 MB the application is
giving OOM error.Is there any alternative way to create bitmap from
large images? What is the maximum heap for an application?
FileInputStream fin = new FileInputStream(new
File("sdcard/DSC00712.jpg"));
if(fin!=null){
Bitmap bitmap = BitmapFactory.decodeStream(fin);
if(bitmap!=null)
img.setImageBitmap(bitmap);
else
Log.e("Bitmap "," Not Created");
Thanks and Regards
Kamal
On Apr 13, 11:47 pm, Romain Guy <[email protected]> wrote:
> onLowMemory() is called when the entire system is runningoutofmemory, not
> when your process is runningoutofmemory. Each app is
> limited to a fixed amount of RAM (24 MB on a Nexus One for instance).
> If you use up these 24 MB but the system still has more RAM available,
> you will get an OutOfMemoryError but not onLowMemory().
>
>
>
>
>
> On Tue, Apr 6, 2010 at 12:27 AM, Atul Moglewar <[email protected]> wrote:
> > Hi,
>
> > I'm working on an application which allocates lot ofmemoryand hence
> > I'm bound to get OutOfMemory. I want a way to get notified when system
> > is running short ofmemoryso that I can stop processing further,
> > notify user and release as muchmemoryas possible.
>
> > According to official Android documentation there is a callback
> > onLowMemory from the system. I have a class which extends
> > android.app.Application and I have overridden onLowMemory() method.
> > This class has entry in the in the application tag of AndroidManifest.
> > However it never gets called in my case. Do I need to register for
> > this event using AndroidManifest or any other means?
>
> > Thanks,
> > Atul
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> > To unsubscribe, reply using "remove me" as the subject.
>
> --
> Romain Guy
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support. All such questions should be posted on
> public forums, where I and others can see and answer them
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en