Based on this answer I configured an intent handler for local RTF files. It works well with a file manager app and with the downloaded file view of Firefox on my Nexus 7 (Android 4.4).
The Downloads apps - which shows files downloaded by Chome - however refuses to open downloaded RTF files with my app. (Error Can't open file).
The same however works well in the emulator (Android 4.0.3): RTF downloaded in the default web browser appear in the Downloads app and can be opened by my RTF viewer.
PDF documents also can be opened directly from the Downloads app.
I also checked that the server where I download the RTF uses one of the specified MIME types (it is application/rtf).
My question is: are there other special requirements to associate an app with the files displayed in the Downloads app view I am missing?
Secondary question: where are the files stored which appear in the Downloads app?
My intent filter:
<intent-filter
android:icon="@drawable/logo"
android:label="View">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" android:host="*"
android:pathPattern=".*\\.rtf" />
<data android:scheme="file" android:host="*"
android:mimeType="application/rtf" />
<data android:scheme="file" android:host="*"
android:mimeType="text/rtf" />
<data android:scheme="file" android:host="*"
android:mimeType="text/richtext" />
</intent-filter>
Permissions:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
0 comments:
Post a Comment