acitivty.finish question

tufanv

Expert
Licensed User
Longtime User
Hello,

As written in the life cycle tutorial :

"If for example you have one activity and the user pressed on the back key, the activity gets closed. Later when the phone gets low on memory (and eventually it will happen) the process will quit.
If the user launches your program again and the process was not killed yet the same process will be reused."

When i use activity.finish , system do not kill my application until it needs to be closed , so when the user launch my app again as written with red above , some process are used again. And when this happens, my app which uses gps for some calculations , is confused and make wrong calculations . Is there any way to avoid this as we dont have an option to instantly kill the app (exitapplicaiton also doesnt kill instanlty)

TY
 

goron

Member
Licensed User
Longtime User
Activity.Finish

Try:
ExitApplication

Immediately ends the application and stops the process.
Most applications should not use this method and prefer Activity.Finish which lets the OS decide when the process is killed.

HTH, Gideon Oron
 
Upvote 0
Top