Login on the Intro screen and proceed to the main page. A (intro) B (main)
A Activity
Intent intent = new Intent(MyIntro.this, MainActivity.class);
startActivity(intent);
finish();
Once the login is complete, use the Intent to move on to the main.
If you take a picture of the log, A.OnPause() -> B.OnCreate() -> A.OnStop() - > A.OnDestroy()
This is the end of activity A. There is no problem with running the app for the first time.
However, I will end the main activity (see that B.OnDestroy() is logged)
When you run the app again, when you move on to A->B, A only goes to OnStop and OnDestroy does not work.
So when the main activity ends, activity A should not be seen, but it will be seen again.
A is Destroyed() about 2~3 times and ends well, but if you repeat after that, A remains A.
Once the app starts and activity A passes, it will not be used again, so it should be terminated normally. How do I solve this?
This is when activity A ended well and did not end well.
If you no longer use "MyIntro" after the screen changes from "MyIntro" to "MainActivity," the following method seems safer than calling the finish() under "startActivity().
a. Call finish() in the Pause() function
@Override
public void onPause() {
super.onPause();
// // Remove the activity when its off the screen
finish();
}
b. Set Android:noHistory property to "true" in AndroidManifest.xml.
<activity
...
android:noHistory="true">
</activity>
Please refer to the site below
765 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
552 GDB gets version error when attempting to debug with the Presense SDK (IDE)
553 Understanding How to Configure Google API Key
552 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.