Created
February 8, 2016 19:53
-
-
Save finnkvan/8abfd33f266d9eb95b27 to your computer and use it in GitHub Desktop.
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
package blogging.pivincii.activitylifecycle; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.View; | |
public class MainActivity extends Activity { | |
private static String TAG = "LifeCycle " + MainActivity.class.getSimpleName(); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Log.i(TAG, "onCreate"); | |
} | |
@Override | |
protected void onStart() { | |
super.onStart(); | |
Log.i(TAG, "onStart"); | |
} | |
@Override | |
protected void onRestart() { | |
super.onRestart(); | |
Log.i(TAG, "onRestart"); | |
} | |
@Override | |
protected void onResume() { | |
super.onResume(); | |
Log.i(TAG, "onResume"); | |
} | |
@Override | |
protected void onPause() { | |
super.onPause(); | |
Log.i(TAG, "onPause"); | |
} | |
@Override | |
protected void onStop() { | |
super.onStop(); | |
Log.i(TAG, "onStop"); | |
} | |
@Override | |
protected void onDestroy() { | |
super.onDestroy(); | |
Log.i(TAG, "onDestroy"); | |
} | |
public void onClick(View view) { | |
switch (view.getId()) { | |
case R.id.next_activity_button: | |
Intent intent = new Intent(MainActivity.this, SecondActivity.class); | |
startActivity(intent); | |
break; | |
default: | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment