当点击任何filebrowser用户通常会从列表至极的应用程序与打开选择文件。 如何添加我的计划,这个完成操作使用-list,从而使文件可以在我的应用程序中打开?
When clicking a file in any filebrowser the user usually gets to choose from a list wich app to open with. How can i add my program to this "Complete action using"-list, so that the file can be opened in my app?
我知道这已被添加到清单莫名其妙,但我找不到添加什么。
I know this has to be added to the manifest somehow, but i can't find what to add.
有人吗?
结果:
我跟着我来到这里的answeres,并使其与此code工作:
I followed the answeres i got here and made it work with this code:
<intent-filter android:label="MyApp">
<action android:name="android.intent.action.VIEW" />
<action android:name="com.MyApp.action.EDIT_NOTE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
<data android:pathPattern=".*txt" />
如何链接到DOC,XLS或PDF格式的文件扩展名的例子:
An example of how to link to doc, xls or pdf file extensions:
<activity android:name="ActivityTest" android:label="@string/app_name">
<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="http" />
<data android:pathPattern=".*doc" />
<data android:pathPattern=".*xls" />
<data android:pathPattern=".*pdf" />
</intent-filter>
</activity>
您还可以创建过滤器为特定的MIME类型。更多信息: http://d.android.com/guide/topics/意图/意向,filters.html
You can also create the filter for specific Mime types. More info: http://d.android.com/guide/topics/intents/intents-filters.html