Use:
destroy, close page activity
If you open the next page and destroy this page, on the next page can not return to this page, each open The app will first show an app 's introduction map, or logo page, delay a few seconds into the application, after entering can no longer return to the Logo page, is to destroy the logo page finish ();
Method:
Finish (); Destroying activity
Activity name . Finish (); destroys the specified activity, equivalent to this
This.finish (); destroy this page activity
Activity name . Instance.finish (); destroy other pages ' activity on this page
usage 1: With the Return key, click the Back button to trigger ontouchevent
@Override public boolean ontouchevent (Motionevent event) {finish (); return true; }
usage 2 : Destroying other pages
On the page that needs to be destroyed://define a static global variable instancepublic static mainactivity instance = null;//in oncreate instance = this; On the page where the destruction was performed: Mainactivity. Instance.finish (); Mainactivity was destroyed.
destruction of the use of activity can save memory! APP online Automation test tool:www.ineice.com
Share: The destruction activity of Android starter development