1、快捷方式权限:

<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

2、创建步骤:

Intent addIntent=new Intent("com.android.launcher.action.INSTALL_SHORTCUT"); Parcelable icon = Intent.ShortcutIconResource.fromContext(ShortCutActivity.this, R.drawable.icon); //获取快捷键的图标          Intent myIntent=new Intent(ShortCutActivity.this, ShortCutActivity.class);           addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "快捷方式");//快捷方式的标题         addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);//快捷方式的图标            addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, myIntent);//快捷方式的动作           sendBroadcast(addIntent);//发送广播

更多相关文章

  1. FFmpeg在Android上的移植优化步骤
  2. Android(安卓)Studio 基础 之 如何取消使用 Android(安卓)X 的操
  3. android 资源收集
  4. Android加载中动画
  5. Android图标靠界面的右边的实现
  6. Android(安卓)ExpandableListView 带有Checkbox的简单应用
  7. 修改android桌面图标默认大小
  8. Android(安卓)9.0 Launcher源码分析(三)——Launcher的布局与多设
  9. Android(安卓)Studio快捷键、配置 Android(安卓)Studio、cmake配

随机推荐

  1. Android有用代码片段(二)
  2. Android使用SQLite数据库(2)
  3. android中Media Playback(媒体播放)
  4. Material Design设计规范
  5. android加载文件的方式,路径的写法
  6. android中创建目录以及txt文件
  7. android代码编写布局和控件
  8. android handler 传递 ArrayList>问题
  9. android之查看SDCard容量
  10. android打开pdf ppt word excel chm html