Android创建快捷方式图标
来源:互联网 发布:mysql数据库免费吗 编辑:程序博客网 时间:2024/05/15 00:05
一个方法,在APP需要的时候调用该方法即可:
public void createShortcutIconInHomeScreen() {Intent addIntent = new Intent();addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent());addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "快捷方式名字");// 不重复创建快捷方式图标。addIntent.putExtra("duplicate", false);// R.drawable.app_logo 快捷方式的图标icon。addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,Intent.ShortcutIconResource.fromContext(getApplicationContext(), R.drawable.app_logo));addIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");getApplicationContext().sendBroadcast(addIntent);}
添加权限:
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
0 0
- Android 创建快捷方式图标
- Android创建快捷方式图标
- android快捷方式图标的创建
- Android 创建快捷方式 删除快捷方式
- Android获取快捷方式图标信息
- Android创建快捷方式,Phonegap创建快捷方式
- Android创建快捷方式(shortcut)
- android 代码创建快捷方式
- android创建快捷方式
- android 创建快捷方式
- Android:创建快捷方式
- android 创建桌面快捷方式
- android 创建快捷方式
- android创建任意快捷方式
- Android创建快捷方式
- android 创建快捷方式
- Android--创建快捷方式
- Android 创建桌面快捷方式
- 常用数据类型的表示范围
- JavaSe——设计模式
- Maven deploy时报Fatal error compiling: tools.jar not found错误的问题处理
- mac系统中文版 download为英文
- NGUI-UIGrid
- Android创建快捷方式图标
- 使用beautifulsoup写的第一个小爬虫程序
- ControlButton
- 社説 20150303 朴大統領演説 硬直した対日姿勢が続くのか
- 图论--坑纪实
- [转] Android中Service的使用详解和注意点
- nginx 负载均衡配置
- 社説 20150303 川崎・中1殺害 少年法の在り方も議論したい
- Linux shell之seq用法