首页 > 移动平台 > 详细

android 应用选择器的使用

时间:2015-03-10 19:45:25      阅读:369      评论:0      收藏:0      [点我收藏+]

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>

android 应用选择器的使用

原文:http://cbg23.blog.51cto.com/7201812/1618910

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!