Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OnLowMemory getting called

Tags:

java

android

I am doing an App which access the gprs .I am facing problem when the user starts another application who uses gprs also like google maps .It takes it own heap memory ,after doing some operation on Maps app it calls OnLowMemory of my service .and my ui is also killed in background. I am not getting any proper tutorial haw can i start my app when it is getting killed during onLowMemory ,or is there any other way to handle it .

Thanks in advance.

like image 663
Sam97305421562 Avatar asked May 05 '10 09:05

Sam97305421562


1 Answers

There's no way you can relaunch your app. The Android OS takes care of killing low priority apps when it starts running out of memory. What you should do is try to save any state before your app gets killed. When the app is launched again, check if there's any state saved and restore your app to the last state.

You should also look as to why your phone is running low on memory, maybe your app is not cleaning up properly or using too many images, bitmaps, etc that use up a lot of memory?

like image 119
Ricardo Villamil Avatar answered Sep 30 '22 16:09

Ricardo Villamil