Skip to content

Instantly share code, notes, and snippets.

@vilmarbfilho
Last active February 1, 2016 11:45
Show Gist options
  • Save vilmarbfilho/d6cea0ffc22025010d66 to your computer and use it in GitHub Desktop.
Save vilmarbfilho/d6cea0ffc22025010d66 to your computer and use it in GitHub Desktop.
Life cycle activity android
public class BaseActivity extends AppCompatActivity{
private static final String TAG = "base_activity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(TAG, "onCreate()");
}
@Override
protected void onStart() {
super.onStart();
Log.i(TAG, "onStart()");
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
Log.i(TAG, "onPostCreate()");
}
@Override
protected void onResume() {
super.onResume();
Log.i(TAG, "onResume()");
}
@Override
protected void onPostResume() {
super.onPostResume();
Log.i(TAG, "onPostResume()");
}
@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
super.onSaveInstanceState(outState, outPersistentState);
Log.i(TAG, "onSaveInstanceState()");
}
@Override
protected void onPause() {
super.onPause();
Log.i(TAG, "onPause()");
}
@Override
protected void onStop() {
super.onStop();
Log.i(TAG, "onStop()");
}
@Override
protected void onRestart() {
super.onRestart();
Log.i(TAG, "onRestart()");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.i(TAG, "onDestroy()");
}
}
@vilmarbfilho
Copy link
Author

Life cycle activity Android

Image of lifecycle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment