Android 将应用程序添加到 "Set as" 或 "Set picture as" 选项列表

Android adding app to "Set as" or "Set picture as" option list

我希望这个问题不会冒犯到别人,我发帖是真心实意的,因为我已经花了几个小时试图找到解决方案。如果可以请帮忙。

我的议程是将我的应用程序放在选择器对话框中,该对话框在用户单击 phone 的图库应用程序中的 "Set as" 或 "Set picture as" 后出现,我知道这当然是可能的,因为 whatsapp 和google 照片已将该应用包含在该列表中。

这是我迄今为止尝试过的方法,但它对我的事业没有帮助,我的应用程序在那里没有功能,请分享您对这个问题的想法。

<activity
    android:name=".ui.ProfileView"
    android:label="@string/app_name"
    android:theme="@style/FullscreenTheme"
    android:windowSoftInputMode="stateHidden" >
    <intent-filter>
        <action android:name="android.intent.action.ATTACH_DATA"/>
        <action android:name="android.intent.action.SET_WALLPAPER"/>
        <data android:mimeType="image/*" />
    </intent-filter>
</activity>

我认为您漏掉了意图的类别。还要记住,一个意图只能有一个动作,所以你可能想要:

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

不确定它是否有效,但试一试。