Android开了开业活动意图过滤器文件 [英] Android Get File that Opened Activity with Intent Filter
问题描述
我做了一个搜索之前,但没有发现什么,我一直在寻找。
I made a search before, but didnt found what I was looking for..
我添加了一个意图过滤到我的活动为特定类型的MIME和扩展,所以当我点击该文件它打开的是假设打开活动。
I added a 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 suppose 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 ;)
编辑:
我有这个在我的AndroidManifest.xml
I Have this on my AndroidManifest.xml
<activity
android:name="com.activities.omega1.SlaveLoadConfig"
android:label="@string/title_activity_slave_load_config"
android:screenOrientation="portrait" >
<intent-filter>
<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="*" />
</intent-filter>
</activity>
和我已经有文件,扩展名.sso打开SlaveLoadConfig活动,但我想有一个处理程序,以获取该文件的内容,怎么样?
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 ?
推荐答案
找到了解决办法:P
Intent intent = getIntent();
intent.getData().toString();
这篇关于Android开了开业活动意图过滤器文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!