Android Question Associate a url to open with my app

Andre Souza

Member
Licensed User
My app works with a part with a specific url .

As I do so that when the user clicks the URL , my app appears on the preference list .

And as I do to treat this amount received ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Andre Souza

Member
Licensed User
Hello

Use code

Manifest
B4X:
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
  <category android:name="android.intent.category.DEFAULT"></category>
  <category android:name="android.intent.category.BROWSABLE"></category>
  <data android:host="app.receitassupreme.com" android:scheme="http"></data>
</intent-filter>)

Code:
B4X:
Dim in As JavaObject = Activity.GetStartingIntent
Log(in.RunMethod("getParcelableExtra", Array("android.intent.extra.STREAM"))

The value only null.
Where is the mistake ?
 
Upvote 0

Andre Souza

Member
Licensed User
The solution work


B4X:
    Dim urlAppInt As Intent
    urlAppInt = Activity.GetStartingIntent
       
    If urlAppInt.ExtrasToString <> "no extras" Then
        Log(urlAppInt.GetData)       
    End If
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…