Activity Lifecycle 20160801

//MainActivity 

 

import android.app.Activity;

import android.os.Bundle;

import android.widget.Toast;

 

public class MainActivity extends Activity {

    /** Called when the activity is first created. */

    @Override

    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

    }

 

    @Override

    public void onStart(){

        super.onStart();

        Toast.makeText(getApplicationContext(),"onStart", Toast.LENGTH_SHORT).show();

    }

 

    @Override

    public void onResume(){

        super.onResume();

        Toast.makeText(getApplicationContext(),"onResume", Toast.LENGTH_SHORT).show();

    }

 

    @Override

    public void onPause(){

        super.onPause();

        Toast.makeText(getApplicationContext(),"onPause", Toast.LENGTH_SHORT).show();

    }

 

    @Override

    public void onRestart(){

        super.onRestart();

        Toast.makeText(getApplicationContext(),"onRestart", Toast.LENGTH_SHORT).show();

    }

 

    @Override

    public void onStop(){

        super.onStop();

        Toast.makeText(getApplicationContext(),"onStop()", Toast.LENGTH_SHORT).show();

    }

 

    @Override

    public void onDestroy(){

        super.onDestroy();

        Toast.makeText(getApplicationContext(),"onDestroy()", Toast.LENGTH_SHORT).show();

    }

}