When creating own Activity subclass, we are overriding some of the basic Activity lifecycle functions.
In which of these we must call super implementation, where we should and where is it only good manner ?
// base lifecycle
onCreate(Bundle savedInstanceState);
onStart();
onRestart();
onResume();
onPause();
onStop();
onDestroy();
finalize();
onUserLeaveHint();
// instance state
onSaveInstanceState(Bundle outState);
onRestoreInstanceState(Bundle savedInstanceState)
// others
onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo);
onCreateOptionsMenu(Menu menu);
onOptionsItemSelected(MenuItem item);
onContextItemSelected(MenuItem item);
onMenuItemSelected(int featureId, MenuItem item);
onActivityResult(int requestCode, int resultCode, Intent data);
onBackPressed();
List of methods is not final, feel free to add more functions, where we should know, what to do.
For those who are interested in, where should be super.methodName
placed
Locations of super() calls in Android Eclipse Plugin generated code reliable?