android - What happens when all activities of an application finishes? -
Scenario:
In my Android application I have four activities, A, B, C and D . To maintain global application status, there is a How do I clear an application stent from exiting the application (back activity of homeactivity)? 1) No, Android does not guarantee much, depending on the OS to decide whether Whether to finish the process or not. 2) Because Each process has its own virtual machine (VM), so the code of an application runs in isolation from other applications. When you call When the components of any application are started when the Android process is executed, then the process closes when it is not needed or when the system is not available to other applications. Should recover the memory. 3) Unless you have a very strong reason, I do not do it. As a rule of thumb, you should handle Android to kill your application, unless there is anything in your application situation, which requires an application reset when the focus is lost. constants.java class in the app that increases the
applications class. In the stable class, all the constant variables in the app are the activity flow such as
a -> b -> c -> D when the back button is pressed from Activity A, then I call the Finnish () which will end the activity and close the application. After this if I'm opening the app from all apps, then there is a variable in
Constants.java , which is the value of the last launch. The same thing is not happening when I
System.exit (10) after
Process.killProcess (Process.myPid ()) Activity A (pressed back)) .
Question:
system.exit (10) to exit the application process? Process.killProcess (Process.myPid ())
Update:
activity example still remains in Dalvik VM. Each process in Android has a separate Dual VM.
the end () , it does not mean that
activity is example collecting garbage. You are saying to Android that you want to close to
activity (do not show it anymore). It will still exist or if the decision to kill the Android process and then terminate the DVI, the garbage is collected.
Comments
Post a Comment