user3375707
user3375707

Reputation:

Android: adding an app to "set picture as" list

I'm trying to add my app to "set as" list, that shown in gallery when I choose an image. If the user open an image in the gallery, there is a button for set as. when the user tap it, he will get a list. In other words, if he want to use that image in my app. I have tried :

<intent-filter>
            <action android:name="android.intent.action.SET_WALLPAPER" />

            <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

but i got nothing.

enter image description here

enter image description here

Upvotes: 3

Views: 205

Answers (2)

Henry
Henry

Reputation: 17841

The intent-filter to add out own app to the list in Gallery and Photos app for "use as" or "set picture as" is ATTACH_DATA.

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

Upvotes: 0

GioLaq
GioLaq

Reputation: 2547

Now i've understand: You have to register your Activity to handle Images input from other apps. Insert this in your Manifest:

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

More infos on Develop>Training>Receiving Simple Data from Other Apps

Upvotes: 1

Related Questions