Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android intent filter data path example

I tried using the following data in my intent filter:

<data android:scheme="http" android:host="an.example.i.p" android:pathPrefix="t" />

Why doesn't the following url trigger it?

http://an.example.i.p/t/v2.aspx/chase/a.test.auto
like image 992
Casebash Avatar asked Aug 24 '10 05:08

Casebash


People also ask

What is intent filters explain intent filters with example?

Implicit intent uses the intent filter to serve the user request. The intent filter specifies the types of intents that an activity, service, or broadcast receiver can respond. Intent filters are declared in the Android manifest file. Intent filter must contain <action>

What is intent filter in android with example?

An intent filter declares the capabilities of its parent component — what an activity or service can do and what types of broadcasts a receiver can handle. It opens the component to receiving intents of the advertised type, while filtering out those that are not meaningful for the component.

What is the difference between intent and intent filter?

An intent is an object that can hold the os or other app activity and its data in uri form.It is started using startActivity(intent-obj).. \n whereas IntentFilter can fetch activity information on os or other app activities.

What is the function of intent filter in android?

An intent filter is an expression in an app's manifest file that specifies the type of intents that the component would like to receive. For instance, by declaring an intent filter for an activity, you make it possible for other apps to directly start your activity with a certain kind of intent.


1 Answers

Try android:pathPrefix="/t". The IntentFilter calls Uri#getPath and pass the resulting string to the PatternMatcher and Uri#getPath returns with the starting /.

like image 157
Rich Schuler Avatar answered Sep 28 '22 20:09

Rich Schuler