There are about 4 ways to close the Android program:
The first type:
CurrentVersion = Android.os.Build.VERSION. (CurrentVersion > Android.os.Build.VERSION_CODES.) {Intent Startmain = Intent (Intent.) Startmain.addcategory (Intent.) Startmain.setflags (Intent.) StartActivity (Startmain) System. ()} {Activitymanager am = (activitymanager) getsystemservice () Am.restartpackage (Getpackagename ())}
This way of shutting down is what I'm using now, and it feels good to be. And it's all about the program and it's all closed down.
The second type:
for (Activity activity:activities) {
& nbsp; activity.finish ();
}
OnDestroy ();
system.exit (0);
This needs to put all the interfaces in a collection, and when the collection has the same activity there will be problems (of course, this problem can be resolved)
Third: android.os.process.killprocess (Android.os.Process.myPid ()) //Get pid
system.exit (0); //Standard exit method for general Java, C #, A return value of 0 indicates normal exit
I don't know how to use it.
The fourth type:
The first step is to show that the method runs on Android 1.5 API level 3 to be able, while requiring permissions
activitymanager am = ( Activitymanager) Getsystemservice (Context.activity_service);
am.restartpackage ( Getpackagename ());
system will , the package under, all processes, services, all killed, you can kill clean, to pay attention to add
<uses-permission android:name=\ "android.permission.restart_packages\" ></uses-permi ssion
I don't know how to use it.
Android off App Program