Skip to content

Instantly share code, notes, and snippets.

@ahmedmtaher
Forked from anonymous/MainActivity.java
Created July 1, 2018 12:46
Show Gist options
  • Save ahmedmtaher/fa5e124ddfce19cd3a71eb26754b3ca4 to your computer and use it in GitHub Desktop.
Save ahmedmtaher/fa5e124ddfce19cd3a71eb26754b3ca4 to your computer and use it in GitHub Desktop.
Activity Lifecycle exercise
package com.example.android.lifecycle;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.v("MainActivity", "onCreate");
}
@Override
protected void onStart() {
super.onStart();
Log.v("MainActivity", "onStart");
}
@Override
protected void onResume() {
super.onResume();
Log.v("MainActivity", "onResume");
}
@Override
protected void onPause() {
super.onPause();
Log.v("MainActivity", "onPause");
}
@Override
protected void onStop() {
super.onStop();
Log.v("MainActivity", "onStop");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.v("MainActivity", "onDestroy");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment