Getting Started in Android Development Part 11 - Finishing an Activity

North Border Software




Home Tutorials Hints & Tips About

Android Apps and Training

Share on Facebook Share on Twitter

Getting Started in Android Development

Part 11 - Finishing an Activity

This tutorial focused on how to exit an Activity gracefully. After adding some extra buttons to the layout, the switch and case statement was expanded with a case statement for the quit button. The only command executed for the quit button case is the finish() method. The finish() methods calls the onDestroy() method and removes the activity from the activity stack.

At the end of this tutorial your MainActivity.java file should look similar to the one below.


At the end of this tutorial your activity_main.xml file should look similar to the one below.


Download Download tutorial set 1

© 2015 North Border Software All rights reserved
Privacy and Cookies Terms of Use Disclaimer Copyright
North Border Software Logo