Android Question Two intent one app

dagodom

Member
Licensed User
Longtime User
Hello
In the manifest file I entered two intents:

B4X:
AddActivityText (Main,
<Intent-filter>
    <action android: name = "android.intent.action.SEND" />
    <category android: name = "android.intent.category.DEFAULT" />
    <data android: mimeType = "image/*" />
</ Intent-filter>)
AddActivityText (Main,
<Intent-filter>
    <action android: name = "android.intent.action.SEND" />
    <category android: name = "android.intent.category.DEFAULT" />
    <data android: mimeType = "video/*" />
</ Intent-filter>)

my problem is that I should recognize when I am called from a share video or from a share image.
I thought I'd check if the substring "/video/" or "/images/" is present in the URI, but I'm not sure it's exhaustive.
Is there a more correct way of understanding for which mimetype I was called?

Thank you
 

dagodom

Member
Licensed User
Longtime User
I think you asked me the right question:

In Intent.ExtrasToString there is a key
KEY_ITEM_MIME_TYPE_LIST = [video / *] in case of video share
and
KEY_ITEM_MIME_TYPE_LIST = [image / *] in case of image share

which are the same as the manifest's intent.

I imagine that by testing this value the result should be correct.

What do you think ?

Thank you
 
Upvote 0
Top