What intent-filters must my app cover to appear in chooser when requestion an image from an external app?

前端 未结 4 796
醉话见心
醉话见心 2020-12-01 15:12

What are the possible intent-filter I need to cover to make sure that any external app requesting an image will see my app in the list?

To clarify, I\'d like my app

相关标签:
4条回答
  • 2020-12-01 15:38

    Some applications may specify the application to open, and some applications have already set the default applications to Open.

    0 讨论(0)
  • 2020-12-01 15:45

    Use this <intent-filter>:

    <intent-filter
        android:icon="@drawable/icon"
        android:label="Share to my app">
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>
    
    0 讨论(0)
  • 2020-12-01 15:46

    The share feature uses the following intent filter

    <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>
    

    Remember that this does not mean an app is requesting a photo but that it wants to send one somewhere.

    0 讨论(0)
  • 2020-12-01 16:00

    I had covered the correct intent-filters, however the Tumblr app requires the category OPENABLE, so instead of the filters I had I'm now using:

    <intent-filter>
        <action android:name="android.intent.action.PICK" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.GET_CONTENT" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.OPENABLE" />
        <data android:mimeType="image/*" />
    </intent-filter>
    

    Only adding the line:

    <category android:name="android.intent.category.OPENABLE" />
    
    0 讨论(0)
提交回复
热议问题