android 应用选择器的使用
16lz
2022-03-15
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中获取应用程序(包)的信息-----PackageManager的使用(一)
- Android(安卓)jetpack Room数据库(一)基本使用
- 获取Android应用程序的签名
- android launch 初探
- [CSDN]Android应用程序启动过程源代码分析
- 转Android(安卓)安全攻防(二): SEAndroid(安卓)bionic
- 基于Android客户端的人人网开放平台开发系列教程
- Hierarchy Viewer 帮你分析应用程序UI布局
- Android(安卓)Launcher全面剖析