Application crashes when it goes to sleep and resume

Put your problem here if it does not fit any of the other categories.

Application crashes when it goes to sleep and resume

Postby NithinG » Fri Sep 18, 2009 1:42 pm

Hi all,

In my application there are utilities which handles my screen data, which can be a singleton class too.

When my application goes to background(
that is if i am pressing home button without Closing my application
) and im taking any other application and using it till my application goes to sleep mode.

After some time if im trying to open my app, its crashing.

My observation is its clearing the variable which are used in my utility classes like calling
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. System.gc();
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

How to persist my application data?
Is there any thing i have to do in application level? For example: AndroidManifest.xml, <Application>

If some one knows how to solve this issue. Please help me.

Thanks in advance,

NithinG
NithinG
Developer
Developer
 
Posts: 36
Joined: Wed Feb 27, 2008 6:24 am

Top

Postby sudheer1437 » Wed Sep 30, 2009 8:23 am

Hi...
did u solve the problem...

i too faced the same problem... so to avoid that.. i did three things...

override 3methods...
1) onPause()
2) onDestroy()
3) onStop()

overriding these three methods will stop crashing when u r pressing home or back button...
u need to write the code in these 3methods wad shud be happened wen those 2 buttons r pressed....

I hope i m clear....
sudheer1437
Experienced Developer
Experienced Developer
 
Posts: 79
Joined: Sat Aug 08, 2009 7:42 am
Location: India

Postby NithinG » Thu Oct 08, 2009 12:43 pm

hi sudeer,

How can persist the data? i mean is there any code to persist the data that can be written in these methods??
NithinG
Developer
Developer
 
Posts: 36
Joined: Wed Feb 27, 2008 6:24 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 13 guests