android 创建快捷方式
2012-12-12 23:35
260 查看
部分代码:
权限配置:
private void shortCut(){ Intent intent = new Intent(); intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT"); intent.putExtra("duplicate", false); intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "hello");//标题 Intent.ShortcutIconResource sr = Intent.ShortcutIconResource.fromContext(this, R.drawable.icon);//自定义图标 intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, sr); intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(this, this.getClass())); this.sendBroadcast(intent); }
权限配置:
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
相关文章推荐
- ubuntu android-studio创建右侧快捷启动方式
- Android工具类之创建快捷方式的方法详解
- Android通过应用程序创建快捷方式的方法
- Android创建桌面快捷方式两种方法
- Android 创建桌面快捷方式
- [Android]为指定的应用创建桌面快捷方式
- android launcher创建删除判断是否存在快捷方式
- android--创建快捷方式和判断是否已经创建
- Android应用添加(创建)和删除及判断是否存在桌面快捷方式
- [Android]为指定的应用创建桌面快捷方式
- Android之创建程序快捷方式
- Android 主界面长按创建快捷方式
- Android创建桌面快捷方式几种方法
- Android创建桌面快捷方式两种方法
- Android创建快捷方式
- Android程序首次运行自动创建桌面快捷方式的方法
- Android为应用在桌面创建快捷方式
- Ubuntu创建Android Studio/Eclipse等快捷方式
- Android实例-为程序创建快捷方式(未测试)
- Android创建桌面快捷方式两种方法