How do i quit running application and why some apps windows not stay in background ?

A

AC Question

For example on my lg g3 android i just tried to run the game backgammon live so now first time i see the game loading in the beginning there is a small progress bar line moving to the right.

Then i see this game icon on the top of my screen and i can roll down it and click the icon and back to the game.

But i didn't find any option in the game to quit it. What i did is just clicking the left arrow on my device <| and i went to the main screen of my device now the icon of the game is not at the top any more but now when i click on the game to start it again it's getting back to the game like the game is still running. It doesn't load it with the progress bar like before.

So the game is still running ? How can i quit it ?


Second problem:

I did an application using android-studio my application is running fine.
But when the application is running on my device and i click to move to another application window or even if i click on my device on the O circle to go to the main screen of my device it's closing my application.

I can't see my application window/icon anywhere on the top.
If i will click on my application on my device it will run it over again.

What could be the reason it's not keeping my application live ?
 

Crashdamage

Well-known member
Jan 18, 2015
1,960
0
0
Visit site
You don't need to worry about closing apps. Please read this:

http://forums.androidcentral.com/sa...w-can-i-tell-if-apps-running.html#post4419264

As for your app closing instead of staying active, i can't say. There could be something in the code that does not allow it. Or the system may need RAM for other processes and shuts the app down to free up resources. This might help you to get a handle on what's happening. It's an article by one of the authors of Android that's an excellent explanation of using Process Stats (aka procstats) to track and understand RAM usage by apps over time.

Android Developers Blog: Process Stats: Understanding How Your App Uses RAM
 

Rukbat

Retired Moderator
Feb 12, 2012
44,529
26
0
Visit site
Android apps are supposed to save their current state every time it changes, so if you make a move, it saves that. Even if you turn the phone off for a few days, when you turn it back on and run the game, you'll be back where you were. That's normal for a lot of games. (It's actually a feature. You don't lose game progress if you have to close the app.)

As for your app - you're not saving its curent state, so when it opens, it start at the beginning. Save the current state every time it changes. When the app opens, check for the current state. If there is none, start at the beginning. If there is one, fill in all your variables, etc., then go from there.

(You really have to - Android can kill your app any time it needs the space - when the user goes back to the app, it should look as if it was still running in the background, even though it was killed.)
 

Trending Posts

Forum statistics

Threads
943,084
Messages
6,917,188
Members
3,158,813
Latest member
pierre5463