问题
I am using android sharing functionality by putting this code in androidmainfest.xml
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
In my application currently i do not support handling of "plain/text". Otherwise i support all other kind of mime types. is there any way i can mention the type in the manifest.xml which i wan't to exclude from handling rather than mentioning all the types which i handle.
cheers, Saurav
回答1:
Propably there is a better solution for blacklisting mimetypes like "text/plain". In my app I also accept all files (for storage purpose) but don't want to receive just Links of dropbox-files or whatever (who are sent as text/plain).
Maybe use a whitelist and suppress textfiles at all:
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="image/*" />
<data android:mimeType="message/*" />
<data android:mimeType="model/*" />
<data android:mimeType="multipart/*" />
<data android:mimeType="video/*" />
</action>
...regarding to http://www.iana.org/assignments/media-types/media-types.xhtml there are just those few mime-groups available.
来源:https://stackoverflow.com/questions/20945600/excluding-the-mime-type-from-android-manifest-file