Android Question Close App With B4XPages

ArminKh1993

Active Member
Hi
As i'm new in B4XPages i want to know how can i close my app(Finish Main Activity) when i'm using b4xpages
Is this code correct?
B4X:
Dim act As Activity = B4XPages.GetNativeParent(Me)
act.Finish

If yes, is this code kill process too?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

ArminKh1993

Active Member
You should close the pages instead with B4XPages.ClosePage(Me).

This just close the current page.
exactly i need something like Activity.Finish inside B4XMainPage to finish activity and close the app
I have just single page which is B4XMainPage
when i used B4XPages.ClosePage(Me) then my app ui will be disappear but the rest of the code I wrote below this code is still running in background
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
when i used B4XPages.ClosePage(Me) then my app ui will be disappear but the rest of the code I wrote below this code is still running in background
This is the expected and desired behavior. If you want to stop doing something while the app is in the background then handle the B4XPage_Background event.
 
Upvote 0

ArminKh1993

Active Member
This is the expected and desired behavior. If you want to stop doing something while the app is in the background then handle the B4XPage_Background event.
I still did not notice
I want the app to be closed so that the main activity can be run from the beginning in the next run and from Activity_Create
These things you say do not close the app
I want to stop my main activity not just pages
 
Upvote 0

ArminKh1993

Active Member
If you want to kill the process then call ExitApplication. The correct solution is to reset the layout and start from scratch.
Just i want finish my main activity
So next time Activity_Create will be raised and pages will recreated again.
 
Upvote 0

ArminKh1993

Active Member
No.


No.

For further information see my previous answers.
I went back to the time before b4xpages
Thank you God for the backup?
I think for me, who still can not close an activity, it will be too early to switch to b4xpages
Thank you for the time you spent
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…