I designed a app with 6 screens(actual application) and i was toggling between screen correctly and there was no error but when i close the application using close application block, next time i open the app it crashes for first time and for the second time it opens.It happens every time the app is closed with close application block.As the original application was big i created a new app which creates the same error, the blocks are shown below,
First screen
Apk file : trial (1).apk (4.8 MB)
Aia file : trial.aia (3.0 KB)
To reproduce the error-
open app, go to screen 2, click on close application (the application will close) and then open app ,and the app crashes without any error or message and again open app it opens .
what does that mean, i have to use close application directly without closing current screen, unfortunately that also induces the same problem, but if i return to screen 1 the same method (which produces error when exited from screen2) works perfectly.
Android apps continue to run in the background, even after you’ve moved on to other tasks or close the app.
Screen2:
Since “close application” could no longer be executed after “close screen” on Screen2, this command remains in the background so that it is first executed the next time the app is opened. This immediately closes the app. It is NOT a crash! If you open the app again afterwards, it works.
So, for whatever reason this approach is desired, try this on Screen2:
That doesn’t mean you should do it that way, it should just demonstrate how the processes work.
So build APK and try.
Note: If you kill all background apps or only this (using the task manager) before you reopen the app, even your first approach will work (proves the same).