创建应用程序的快捷方式如下:

Action

private static final String ACTION_INSTALL_SHORTCUT = "com.android.launcher.action.INSTALL_SHORTCUT";

Intent shortcutIntent = new Intent(ACTION_INSTALL_SHORTCUT);shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME,getString(R.string.app_name));shortcutIntent.putExtra(EXTRA_SHORTCUT_DUPLICATE, false);Intent intent = new Intent();intent.setComponent(new ComponentName(this.getPackageName(),".Splash"));shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent);shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,Intent.ShortcutIconResource.fromContext(this,R.drawable.icon));sendBroadcast(shortcutIntent);

Uses permission

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

删除快捷方式试了很久没测试成功过,不知那位同学贡献一下代码?

更多相关文章

  1. 获取android系统信息或应用程序信息
  2. **android studio 编写淘宝界面## 标题**
  3. Android定时自动启动应用程序
  4. Android创建快捷方式(shortcut)
  5. Android(安卓)Bundle类
  6. 关于 Activity 中 must implement OnFragmentInteractionListene
  7. 构建更好的应用--Xamarin平台
  8. Android沉浸式状态栏
  9. android如何获取后台正在运行的service

随机推荐

  1. android之JSON解析(一)
  2. android bitmap drawable 互转
  3. android手机内部存储空间和外部存储空间
  4. mono for android之文件系统与应用程序首
  5. Android(安卓)记住密码和自动登录界面的
  6. RSA算法 Android(安卓)JAVA C#互通
  7. 【Android(安卓)开发】:Android中普通按钮
  8. Android用Sax,Pull,Dom解析xml
  9. Android编译大全(六、七)
  10. android ActionBar-PullToRefresh 下拉刷