安卓:添加一个应用程序到"设置图片为"名单 [英] 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.
推荐答案
现在我已经明白了: 你必须注册你的活动,以处理来自其他应用的图像输入。 插入这在你的清单:
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>
更多的相关信息在发展>培训>接收从其他应用程序简单的数据
这篇关于安卓:添加一个应用程序到&QUOT;设置图片为&QUOT;名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文