使活动出现在“壁纸选择器” [英] Make activity appear in the 'wallpaper chooser'

查看:122
本文介绍了使活动出现在“壁纸选择器”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的行为出现在活动列表(画廊。动态壁纸等)时,尽量选择从主屏幕壁纸,你看到的。

I want my activity to appear in the list of activities (gallery. live wallpapers, etc) that you see when you try to choose a wallpaper from the home screen.

林假设这是有意向做,但不能似乎找到一个工作。最近的一个我能找到的:

Im assuming this is done with intents but cant seem to find one that works. The closest one I can find is:

<action android:name="android.intent.action.ACTION_SET_WALLPAPER>

但是,这并不工作,似乎是用别的东西。

but that doesn't work and seems to be used for something else.

推荐答案

这应该是意图过滤器,你想要的:

This should be the intent-filter you want:

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

定义如下:<一href="http://developer.android.com/reference/android/content/Intent.html#ACTION_SET_WALLPAPER">http://developer.android.com/reference/android/content/Intent.html#ACTION_SET_WALLPAPER

(默认类别是意图标准的语法。)

(The DEFAULT category is a standard syntax for intents.)

这篇关于使活动出现在“壁纸选择器”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆