Deepak Sharma
Deepak Sharma

Reputation: 5063

Issue when application is running in background

I am facing an absolutely abnormal problem in my android application.Scenario is like that:-

I have a main activity in which a button is placed named as SOS .On long press the button,another activity is launched in which a timer starts.

The timer is executed in a service so that it can be easily runs in background also. Now the timer is running and when i pressed the home button of the device the app goes in background.Till now its fine.Now the problem is that when I again launch the application by clicking the application icon.The timer is not visible.

The application starts again from scratch.but the timer is still running in the background.What I want that,the same screen should be reopened when the application is launched again that is Timer screen.Now this problem is not arises when I deploy the build from the eclipse.Everything is working fine in this case.

But when I deploy the build in the device after downloading from the mail account,the above problem arises.

Please help me to sort out this problem.

Upvotes: 1

Views: 258

Answers (1)

Pankaj Zanzane
Pankaj Zanzane

Reputation: 1242

Hope you know the behavior of Android OS, When your Activity is in background and OS need to free some memory it will kill your app and start it again when you need. If everything is right in your logic then might be your app being terminated by OS.

Upvotes: 1

Related Questions