If you worked with programming language like C, C++ or Java. That means you know that program is start with the main() function. There is a sequence of callback methods that start up an activity and a sequence of callback methods that tear down an activity as shown in Activity life cycle diagram. The Activity class defines the following call backs i.e. events. You don't need to implement all the callbacks methods. You only need to understand all. onCreate() onStart() onResume() onPause() onStop() onDestroy() onRestart() Following is the code of the modified main activity file src/com.example.sample/MainActivity.java . The Log.d() method has been used to generate log messages. package com . example . sample ; import android . os . Bundle ; import android . app . Activity ; import android . util . Log ; public class MainActivity extends Activity { String msg = "Android : " ; @Override public void onCreate ( ...