android 应用选择器的使用

发布时间:2020-07-02 06:52:48 作者:向往宇宙
来源:网络 阅读:933

1、

AndroidManifest.xml文件中具有:

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


Intent i = new Intent(Intent.ACTION_SET_WALLPAPER);
        //i.setType("text/plain");
        //i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        
        startActivity(Intent.createChooser(i, "share with ..."));


应用程序根据action查找系统中的应用程序,当然也可以加上其他信息。

2、让我们的应用程序被应用程序选择器找到。

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

推荐阅读:
  1. Android 一起来看看知乎开源的图片选择库
  2. 探索android的底部导航视图

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

应用程序 action 信息

上一篇:php笔记:单例模式

下一篇:华为设备二层交换技术——Hybrid接口详解

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》