Android: filter settings for a specific Uri template

I need my Android application to trigger a specific action in my application, responding to the following Uri data from the sent intent:

http://www.example.com/redirect.aspx?customurl=example%3a%2f%2f%3fop%3dexampledetail%26stuff%3d12345%26morestuff%3dI%2520Love%25Android

If I use the following in my manifest (for the action I want to respond to the intent), I can commit this, but the selector appears (which I don't need):

<intent-filter>
 <action android:name="android.intent.action.VIEW" />
 <data android:scheme="http" android:host="www.example.com" />
 <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

Since I don't want the selector to pop up, I tried using android: pathPattern or android: pathPrefix in the tag for further filtering, to make sure that only my application responds, but it does not work for me.

Can someone help me do this?

+3
2

, , , URL "private" , URL- EXTRA .

- :

Uri privateUri = Uri.parse("http://yourserver.com/path/to/data");
Intent i = new Intent(context, yourActivity.class);
i.putExtra("DATA_URI", privateUri);
startActivity(i);

yourActivity.class Uri :

Uri privateUri = (Uri) getIntent().getParcelableExtra("DATA_URI");
+6

( , ), , ( ):

Android 1+ . URL , . , , URL- HTTP, .

, -, URL-, , -: , smarts , , Android, URL .

+7

Source: https://habr.com/ru/post/1773319/


All Articles