Skip to content Skip to sidebar Skip to footer

Intent-filter: How To Accept Only "text/plain" Intents Containing The Word "spaghetti"

My app is about spaghetti, and it should allow you to share any text/plain content provided it's about spaghetti. So I need an intent-filter that accepts only such content. In cas

Solution 1:

Is this possible at all?

No.

Workarounds are welcome.

Accept all text, and if the text does not contain references to suitable pasta products, show an error and possibly finish() your activity to return the user to wherever they came from.

You could invent your own MIME type (e.g., application/vnd.cprcrack.al.dente), but since approximately zero other apps will be sharing things with that MIME type, the user will get hungry.


Post a Comment for "Intent-filter: How To Accept Only "text/plain" Intents Containing The Word "spaghetti""