Android:将应用程序添加到“将图片设置为”列表

2023-12-14

我正在尝试将我的应用程序添加到“设置为”列表,当我选择图像时,该列表会显示在图库中。如果用户在图库中打开图像,则会有一个按钮set as。当用户点击它时,他会得到一个列表。换句话说,如果他想在我的应用程序中使用该图像。 我努力了 :

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

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

但我什么也没得到。

enter image description here

enter image description here


现在我明白了: 您必须注册您的活动才能处理来自其他应用程序的图像输入。 将其插入您的清单中:

<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>

更多信息关于开发>培训>从其他应用程序接收简单数据

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android:将应用程序添加到“将图片设置为”列表 的相关文章