How to exit the Android system

Source: Internet
Author: User

I checked a lot of information online and found that many methods could not exit.

The following information

Http://www.android123.com.cn/androidkaifa/519.html

Http://www.2cto.com/kf/201111/111395.html

Http://android.tgbus.com/Android/tutorial/201103/347436.shtml

 

Can not exit normally, I wrote the following program, my program under sdk2.2 through

Write in baseaciti.pdf. Java

Public static list <activity> activitylist = new arraylist <activity> ();

@ Override
Protected void oncreate (bundle savedinstancestate ){
// Todo auto-generated method stub
Super. oncreate (savedinstancestate );
Activitylist. Add (this );

}

 

On the exit page, write:

On the homepage, finish all the activities and exit,

Public Class AA extends baseaciti.pdf {

If (strtitle. Revoke signorecase ("quit "))
{
Log. D ("activity count:", activitylist. Size () + "");
For (INT I = 0; I <activitylist. Size (); I ++)
{
If (null! = Activitylist. Get (I ))
{
Activitylist. Get (I). Finish ();
}
}
System. Exit (0 );

}

}

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.