Android Question App reruns when back is pressed during google voice recognition

MegatenFreak

Active Member
Licensed User
Hi.
My app shows users short video clips and then opens Google voice recognition so they can repeat what they heard.
problem is, sometimes they haven't heard the clip or are simply not ready, so they press back to go back (since there's no way to 'repeat' or 'cancel' Google VR), but when they do, the app quits and restarts.
how do I make it so going back from Google VR returns control to the app right at that point?
Thanks a lot in advance.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It depends on whether the process is actually being killed or not. If it is killed (FirstTime = True) then migrating to B4XPages will not help. You can solve this case with a foreground service. It will prevent Android from killing the process while the app is in the background.
 
Upvote 0

MegatenFreak

Active Member
Licensed User
EDIT:
Problem solved. My own mistake. Apparently I had set up the app to exit in case Google VR returns FALSE. I was under the impression that it would mean the VR system isn't working. Apparently FALSE is also returned if the user presses the back button!!
Damn it's so frustrating when you return to your old code after a long time!!
 
Last edited:
Upvote 0
Top