ArminKh1993 Active Member Mar 23, 2021 #1 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: Copy Dim act As Activity = B4XPages.GetNativeParent(Me) act.Finish If yes, is this code kill process too?
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: Copy 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 Mar 23, 2021 #2 ArminKh1993 said: Is this code correct? Click to expand... You should close the pages instead with B4XPages.ClosePage(Me). ArminKh1993 said: If yes, is this code kill process too? Click to expand... No. It is the responsibility of the OS to kill the process when the app is in the background. Upvote 0
ArminKh1993 said: Is this code correct? Click to expand... You should close the pages instead with B4XPages.ClosePage(Me). ArminKh1993 said: If yes, is this code kill process too? Click to expand... No. It is the responsibility of the OS to kill the process when the app is in the background.
ArminKh1993 Active Member Mar 23, 2021 #3 Erel said: You should close the pages instead with B4XPages.ClosePage(Me). Click to expand... 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 said: You should close the pages instead with B4XPages.ClosePage(Me). Click to expand... 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
Erel B4X founder Staff member Licensed User Longtime User Mar 24, 2021 #4 ArminKh1993 said: 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 Click to expand... 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 said: 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 Click to expand... 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.
ArminKh1993 Active Member Mar 24, 2021 #5 Erel said: 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. Click to expand... 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
Erel said: 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. Click to expand... 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
Erel B4X founder Staff member Licensed User Longtime User Mar 24, 2021 #6 If you want to kill the process then call ExitApplication. The correct solution is to reset the layout and start from scratch. Upvote 0
If you want to kill the process then call ExitApplication. The correct solution is to reset the layout and start from scratch.
ArminKh1993 Active Member Mar 24, 2021 #7 Erel said: If you want to kill the process then call ExitApplication. The correct solution is to reset the layout and start from scratch. Click to expand... Just i want finish my main activity So next time Activity_Create will be raised and pages will recreated again. Upvote 0
Erel said: If you want to kill the process then call ExitApplication. The correct solution is to reset the layout and start from scratch. Click to expand... Just i want finish my main activity So next time Activity_Create will be raised and pages will recreated again.
Erel B4X founder Staff member Licensed User Longtime User Mar 24, 2021 #8 ArminKh1993 said: Is this code correct? Click to expand... No. ArminKh1993 said: If yes, is this code kill process too? Click to expand... No. For further information see my previous answers. Upvote 0
ArminKh1993 said: Is this code correct? Click to expand... No. ArminKh1993 said: If yes, is this code kill process too? Click to expand... No. For further information see my previous answers.
ArminKh1993 Active Member Mar 24, 2021 #9 Erel said: No. No. For further information see my previous answers. Click to expand... 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
Erel said: No. No. For further information see my previous answers. Click to expand... 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