Last active
September 8, 2015 18:16
-
-
Save cgonzalezdai/997eed1a8886175111f3 to your computer and use it in GitHub Desktop.
Implementing the lifecycle callbacks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// code from http://developer.android.com/guide/components/activities.html#ImplementingLifecycleCallbacks | |
public class ExampleActivity extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
// The activity is being created. | |
} | |
@Override | |
protected void onStart() { | |
super.onStart(); | |
// The activity is about to become visible. | |
} | |
@Override | |
protected void onResume() { | |
super.onResume(); | |
// The activity has become visible (it is now "resumed"). | |
} | |
@Override | |
protected void onPause() { | |
super.onPause(); | |
// Another activity is taking focus (this activity is about to be "paused"). | |
} | |
@Override | |
protected void onStop() { | |
super.onStop(); | |
// The activity is no longer visible (it is now "stopped") | |
} | |
@Override | |
protected void onDestroy() { | |
super.onDestroy(); | |
// The activity is about to be destroyed. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment