Skip to content

Instantly share code, notes, and snippets.

@phyous
Created August 7, 2014 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phyous/0cd35151f0ba91254b73 to your computer and use it in GitHub Desktop.
Save phyous/0cd35151f0ba91254b73 to your computer and use it in GitHub Desktop.
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
public class MyActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
Log.i("MyActivity", "Activity Launched!");
Log.i("MyActivity", "onCreate()");
}
@Override
protected void onStart() {
super.onStart();
Log.i("MyActivity", "Activity visible, not in foreground");
Log.i("MyActivity", "onStart()");
}
@Override
protected void onResume() {
super.onResume();
Log.i("MyActivity", "Activity visible, now in foreground");
Log.i("MyActivity", "onResume()");
}
@Override
protected void onPause() {
super.onPause();
Log.i("MyActivity", "Activity visible, not in foreground");
Log.i("MyActivity", "onPause()");
}
@Override
protected void onStop() {
super.onStop();
Log.i("MyActivity", "Activity no longer visible");
Log.i("MyActivity", "onStop()");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.i("MyActivity", "Activity finished & destroyed");
Log.i("MyActivity", "onDestroy()");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment