TiagoM TiagoM - 2 years ago 128
Android Question

Android Get File that Opened Activity with Intent Filter

I added an intent filter to my activity for a specific type of mime and extension, so when I click on that file it opens the activity that is supposed to open.

Thats awesome, and its working!

But how can I get the file that I clicked?
I guess that its possible.

Can someone give me some hints?
Thanks alot in advance ;)


I Have this on my AndroidManifest.xml

android:screenOrientation="portrait" >
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="file" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.sso" />
<data android:host="*" />

And I already have files with extension .sso opening the SlaveLoadConfig activity, but I would like to have an handler to get the content of the file, how ?

Answer Source

Found the solution :P

Intent intent = getIntent();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download