Hi Everyone,
I started to create a new app with the current version of B4A and noticed that using Activity.Finish closes the other activity and does not display the main activity that called the other activity. The app terminates without displaying the main activity and the Sub Activity_Resume coding never executes upon closing the other activity. I'm not sure why this happens. The same thing happens when I tap the "Back" button on my phone as well.
This is the first time this has happened to me.
I'm using this code to call another activity:
I'm using this code to return to the main activity from the other activity because Activity.Finish is not working:
This coding calls the main activity but I'm afraid that if the user keeps going back and forth between the main activity and the other activity, memory will eventually run out of the Android device they are using.
I'm using this coding in the Activity_Resume of the main activity:
I also commented this coding out just to make sure it was not causing a problem.
Thanks.
I started to create a new app with the current version of B4A and noticed that using Activity.Finish closes the other activity and does not display the main activity that called the other activity. The app terminates without displaying the main activity and the Sub Activity_Resume coding never executes upon closing the other activity. I'm not sure why this happens. The same thing happens when I tap the "Back" button on my phone as well.
This is the first time this has happened to me.
I'm using this code to call another activity:
B4X:
Sub CustomViewSettings_Up()
StartActivity(Settings)
End Sub
I'm using this code to return to the main activity from the other activity because Activity.Finish is not working:
B4X:
Sub CustomViewExit_Up()
StartActivity(Main)
' Activity.Finish
End Sub
This coding calls the main activity but I'm afraid that if the user keeps going back and forth between the main activity and the other activity, memory will eventually run out of the Android device they are using.
I'm using this coding in the Activity_Resume of the main activity:
B4X:
' Neatly arrange views.
'----------------------
Utils.CenterViewOnBottom(CustomViewExit, PanelMenu, 75)
Utils.CenterViewOnBottom(CustomViewDisable, PanelMenu, 250 )
Utils.CenterViewOnBottom(CustomViewEnable, PanelMenu, 425)
Utils.CenterViewOnBottom(CustomViewSettings, PanelMenu, 600)
bm.Initialize(LoadBitmap(File.DirAssets,"Settings.png"))
CustomViewSettings.setIcon(False,bm)
I also commented this coding out just to make sure it was not causing a problem.
Thanks.
Last edited: