moster67 Expert Licensed User Longtime User Sep 24, 2016 #1 How can we use moveTaskToBack in B4A? https://developer.android.com/reference/android/app/Activity.html#moveTaskToBack or is it equivalent to Activity.Finish? (I don't think so)
How can we use moveTaskToBack in B4A? https://developer.android.com/reference/android/app/Activity.html#moveTaskToBack or is it equivalent to Activity.Finish? (I don't think so)
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2016 #2 You can use this code: Code: Copy Dim jo As JavaObject jo.InitializeContext jo.RunMethod("moveTaskToBack", Array(True)) Upvote 0
You can use this code: Code: Copy Dim jo As JavaObject jo.InitializeContext jo.RunMethod("moveTaskToBack", Array(True))
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2016 #4 What do you use it for? Upvote 0
moster67 Expert Licensed User Longtime User Sep 25, 2016 #5 In the thread B4A ScreenRecording, I am attaching a sample app. In this sample app, there is a method which calls StartRecording. Currently users have to tap home button to get rid of the sample app activity and this get fetched in the recording. By using moveTaskToBack(), activity will move back into the background and the home screen is immediately visibile. Of course, it is up to the users to handle this (they can implement a timer so recording does not start immediately) but I saw another app using moveTaskToBack() and I couldn't find it in B4A. Upvote 0
In the thread B4A ScreenRecording, I am attaching a sample app. In this sample app, there is a method which calls StartRecording. Currently users have to tap home button to get rid of the sample app activity and this get fetched in the recording. By using moveTaskToBack(), activity will move back into the background and the home screen is immediately visibile. Of course, it is up to the users to handle this (they can implement a timer so recording does not start immediately) but I saw another app using moveTaskToBack() and I couldn't find it in B4A.
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2016 #6 Can't you call Activity.Finish to close the recording activity (I haven't tried your example)? Upvote 0
moster67 Expert Licensed User Longtime User Sep 25, 2016 #7 I tried Activity.Finish but the video output files seemed to become corrupted and was not playable. Note: I haven't researched why this happens with Activity.Finish but moveTaskToBack() works fine so I am cool with it Upvote 0
I tried Activity.Finish but the video output files seemed to become corrupted and was not playable. Note: I haven't researched why this happens with Activity.Finish but moveTaskToBack() works fine so I am cool with it