Android Question [Solved] How to restart a B4XPages App?

asales

Expert
Licensed User
Longtime User
I changed my multilanguage app from activity to b4xpage.

I have an option to change the language in B4XDrawer menu of the main page.
In the activity previous code I just ask to the user close and reopen the app.
In the reopen the itens of the menu and several others components in the main screen is translated.

How can I made this in the B4XPages: restart the app to reacreate the main page?

Thanks in advance for any tip.
 

AnandGupta

Expert
Licensed User
Longtime User
Thanks @LucaMs. I don't use ExitApplication because of this explanation from Erel.

But I found this code from @agraham, put it in the Main module, call it from the b4xpage and work fine.
B4X:
Sub RestartActivity
    Activity.Finish
    StartActivity(Me)
End Sub
Thanks for lead. May come in handy for some cases as B4XPages is always on.
 
Upvote 0
Top