I have 1 application custom class MyApplication.java and 1 activity MainActivity.java.
At the first time when I start app, class MyApplication.java run correctly. Then I exit app by finish the activity
MainActivity.this.finish();
Then I click the app icon in screen to start it again. But this time, MyApplication.java do not run. It means that I can't exit app by finishing all activities?
I can't explain why.
P/s: Here is my code
MyApplication.java
@Override
public void onCreate() {
super.onCreate();
Log.d(TAG, "onCreate: ");
}
MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d(TAG, "onCreate: ");
}
@Override
public void onBackPressed() {
this.finish();
}