Android Question Two intent one app

Discussion in 'Android Questions' started by dagodom, Aug 25, 2019.

  1. dagodom

    dagodom Member Licensed User

    Hello
    In the manifest file I entered two intents:

    Code:
    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
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    What is the output of Log(Intent.ExtrasToString) ?
     
  3. dagodom

    dagodom Member Licensed 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
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    I agree.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice