Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.myapplication;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.app.Activity;
- import android.util.Log;
- import android.view.Menu;
- import android.content.res.Configuration;
- public class MainActivity extends AppCompatActivity {
- private static final String LOG_TAG = "Kamil Rachuba";
- static final String STORE_STATE="myStoredState";
- int thenStoredState = 0;
- public MainActivity()
- {
- super();
- Log.d(LOG_TAG,"obrot ekranu");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- if(savedInstanceState != null) {
- thenStoredState = savedInstanceState.getInt(STORE_STATE);
- ++thenStoredState;
- }
- Log.d(LOG_TAG, "onCreate");
- Log.i(LOG_TAG,"thenStoredState="+thenStoredState);
- }
- @Override
- protected void onSaveInstanceState(Bundle outState){
- super.onSaveInstanceState(outState);
- outState.putInt(STORE_STATE,thenStoredState);
- Log.d(LOG_TAG,"onSaveInstanceState");
- }
- @Override
- protected void onDestroy(){
- super.onDestroy();
- Log.d(LOG_TAG,"onDestroy");
- }
- @Override
- public void onBackPressed(){
- super.onBackPressed();
- Log.d(LOG_TAG,"onBackPressed");
- }
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- Log.d(LOG_TAG, "onConfigurationChanged");
- }
- @Override
- protected void onPause(){
- super.onPause();
- Log.d(LOG_TAG,"onPause");
- }
- @Override
- protected void onPostCreate(Bundle savedInstanceState){
- super.onPostCreate(savedInstanceState);
- Log.d(LOG_TAG,"onPostCreate");
- }
- @Override
- protected void onPostResume(){
- super.onPostResume();
- Log.d(LOG_TAG,"onPostResume");
- }
- @Override
- protected void onRestart(){
- super.onRestart();
- Log.d(LOG_TAG,"onRestart");
- }
- @Override
- protected void onResume(){
- super.onResume();
- Log.d(LOG_TAG,"onResume");
- }
- @Override
- protected void onStart(){
- super.onStart();
- Log.d(LOG_TAG,"onStart");
- }
- @Override
- protected void onStop(){
- super.onStop();
- Log.d(LOG_TAG,"onStop");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement