1. Finish () method
This method can end the current activity, but if your app has many activities, it seems a little too slow to use this method.In addition, there is also a method finishactivity (INT requestcode). For this method, first look at the
(1) define the stack, write an Exitactivity class, and manage the Activity in singleton mode.The onCreate () method of the Activity calls the Exitactivity. getInstance (). addActivity (this) method.Call Exitactivity. getInstance (). exit () to exit
Author: Li luqun
Author Profile
Li luqun, male, associate professor. He is mainly engaged in the research and teaching of Java J2EE and j2's integrated applications, spatial web service, and mobile GIS applications. You can contact the author via
1. Graceful exit of the process 1.1.kill-9 PID problemsIt is easy and efficient to force a process to be killed by Kill-9 PID on Linux, so many program stop scripts often choose how to use the kill-9 PID.Whether the Kill-9 PID of Linux or the
A complete Java applicationProgramUsually there must be at least one end point of the application. For general programs, system developers add system at the end of the program based on their needs and personal preferences. exit (0), or system. out (-
Program
A complete Java application that usually has at least one end point for the application. For a general program, the system developer ends the program at the end of the program by adding System.exit (0), or System.out (-1), depending on the
Let's take a look at the several solutions currently provided on the Internet:
1. Exit A single activity
1) obtain the ID of the current process and kill the process. Android. OS. process. killprocess (Android. OS. process. mypid ())
2) Terminate
js| Solution | Problem Summary
In a password-protected Web application, it is not just a matter of calling the HttpSession invalidate () method to properly handle the user exit process. Now most browsers have back and forward buttons that allow the
Java is very attractive, but for beginners who have just entered the Java threshold, compiling and running a very simple Java program is simply a nightmare. Clearly, the program is correct, but all kinds of confusing error messages really make you
In a password-protected Web application, it is not just a matter of calling the HttpSession invalidate () method to properly handle the user exit process. Now most browsers have back and forward buttons that allow the user to step back or forward to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.