Android Question data android:scheme/host

fbritop

Active Member
Licensed User
Longtime User
I have in mi manifest
B4X:
    <data android:scheme="https" />
    <data android:host="app.llavemovil.com" />

So when a user clicks on a link that starts with app.llavemovil.com:// y goes straight to my app (sometimes with params).

If I send that link through whatsapp for ex, the from whatsapp, when I click, it offers me to which app I want to open. If I proceed, then it opens my B4AMainPage.

When I press the back button on my app, it shows the desktop. But if I click on WhatsApp, it takes me directly to my app without any indications. So I have no way to open WhatsApp, unless I kill my App.

What should I do when the user closes B4XMain back (through the back button), so that it does not get trapped in whatsapp.

Thanks
FBP
 

fbritop

Active Member
Licensed User
Longtime User
Try this:
B4X:
Private Sub B4XPage_CloseRequest As ResumableSub
    B4XPages.GetNativeParent(Me).Finish
    Return False
End Sub
Thanks @Erel but I found out that adding this line in the manifest did the job.

B4X:
SetActivityAttribute(Main, android:launchMode, "singleTask")
 
Upvote 0
Top