Created
June 22, 2021 10:59
-
-
Save extsalt/9582125bc941b885a30e99765bf680c2 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 com.example.mycalculator; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Log; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import android.widget.TextView; | |
public class MainActivity extends AppCompatActivity { | |
EditText num1, num2; | |
TextView result; | |
Button button; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
//1 | |
setContentView(R.layout.activity_main); | |
Log.d("ON_CREATE", "called"); | |
} | |
@Override | |
protected void onStart() { | |
super.onStart(); | |
//2 | |
Log.d("ON_START", "called"); | |
} | |
@Override | |
protected void onResume() { | |
super.onResume(); | |
//3 | |
Log.d("ON_RESUME", "called"); | |
} | |
@Override | |
protected void onPause() { | |
super.onPause(); | |
//4 when another activity is visible | |
Log.d("ON_PAUSE", "called"); | |
} | |
@Override | |
protected void onStop() { | |
super.onStop(); | |
//5 when activity is no longer visible | |
Log.d("ON_STOP", "called"); | |
} | |
@Override | |
protected void onRestart() { | |
super.onRestart(); | |
//6 this comes after onStop method | |
Log.d("ON_RESTART", "called"); | |
} | |
@Override | |
protected void onDestroy() { | |
super.onDestroy(); | |
// 7 before when application being killed. | |
Log.d("ON_DESTROY", "called"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment