Advertisement
Guest User

krupnik zad 3 mainactivity.java

a guest
Mar 19th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. package com.example.myapplication;
  2.  
  3.  
  4. import android.support.v7.app.AppCompatActivity;
  5. import android.os.Bundle;
  6. import android.app.Activity;
  7. import android.util.Log;
  8. import android.view.Menu;
  9. import android.content.res.Configuration;
  10.  
  11. public class MainActivity extends AppCompatActivity {
  12. private static final String LOG_TAG = "Kamil Rachuba";
  13. static final String STORE_STATE="myStoredState";
  14. int thenStoredState = 0;
  15. public MainActivity()
  16. {
  17. super();
  18. Log.d(LOG_TAG,"obrot ekranu");
  19. }
  20.  
  21. @Override
  22. protected void onCreate(Bundle savedInstanceState) {
  23. super.onCreate(savedInstanceState);
  24. setContentView(R.layout.activity_main);
  25. if(savedInstanceState != null) {
  26. thenStoredState = savedInstanceState.getInt(STORE_STATE);
  27. ++thenStoredState;
  28. }
  29. Log.d(LOG_TAG, "onCreate");
  30. Log.i(LOG_TAG,"thenStoredState="+thenStoredState);
  31. }
  32. @Override
  33. protected void onSaveInstanceState(Bundle outState){
  34. super.onSaveInstanceState(outState);
  35. outState.putInt(STORE_STATE,thenStoredState);
  36. Log.d(LOG_TAG,"onSaveInstanceState");
  37. }
  38. @Override
  39. protected void onDestroy(){
  40. super.onDestroy();
  41. Log.d(LOG_TAG,"onDestroy");
  42. }
  43. @Override
  44. public void onBackPressed(){
  45. super.onBackPressed();
  46. Log.d(LOG_TAG,"onBackPressed");
  47. }
  48. @Override
  49. public void onConfigurationChanged(Configuration newConfig) {
  50. super.onConfigurationChanged(newConfig);
  51. Log.d(LOG_TAG, "onConfigurationChanged");
  52. }
  53. @Override
  54. protected void onPause(){
  55. super.onPause();
  56. Log.d(LOG_TAG,"onPause");
  57. }
  58. @Override
  59. protected void onPostCreate(Bundle savedInstanceState){
  60. super.onPostCreate(savedInstanceState);
  61. Log.d(LOG_TAG,"onPostCreate");
  62. }
  63. @Override
  64. protected void onPostResume(){
  65. super.onPostResume();
  66. Log.d(LOG_TAG,"onPostResume");
  67. }
  68. @Override
  69. protected void onRestart(){
  70. super.onRestart();
  71. Log.d(LOG_TAG,"onRestart");
  72. }
  73. @Override
  74. protected void onResume(){
  75. super.onResume();
  76. Log.d(LOG_TAG,"onResume");
  77. }
  78. @Override
  79. protected void onStart(){
  80. super.onStart();
  81. Log.d(LOG_TAG,"onStart");
  82. }
  83. @Override
  84. protected void onStop(){
  85. super.onStop();
  86. Log.d(LOG_TAG,"onStop");
  87. }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement