smartcomputing123

android-activity101

Aug 22nd, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. package com.example.activity101;
  2.  
  3. import androidx.appcompat.app.AppCompatActivity;
  4. import android.util.Log;
  5. import android.os.Bundle;
  6.  
  7. public class MainActivity extends AppCompatActivity {
  8.     String tag = "Lifecycle Step";
  9.     @Override
  10.     protected void onCreate(Bundle savedInstanceState) {
  11.         super.onCreate(savedInstanceState);
  12.         setContentView(R.layout.activity_main);
  13.         Log.d(tag, "In the onCreate() event");
  14.     }
  15.     public void onStart()
  16.     {
  17.         super.onStart();
  18.         Log.d(tag, "In the onStart() event");
  19.     }
  20.     public void onRestart()
  21.     {
  22.         super.onRestart();
  23.         Log.d(tag, "In the onRestart() event");
  24.     }
  25.     public void onResume()
  26.     {
  27.         super.onResume();
  28.         Log.d(tag, "In the onResume() event");
  29.     }
  30.     public void onPause()
  31.     {
  32.         super.onPause();
  33.         Log.d(tag, "In the onPause() event");
  34.     }
  35.     public void onStop()
  36.     {
  37.         super.onStop();
  38.         Log.d(tag, "In the onStop() event");
  39.     }
  40.     public void onDestroy()
  41.     {
  42.         super.onDestroy();
  43.         Log.d(tag, "In the onDestroy() event");
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment