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

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调用js
  2. Android(安卓)webview监听网页对话框点击事件
  3. Android中ExpandableListView控件基本使用
  4. Android(安卓)将自己的应用程序改成系统的应用程序
  5. Android(安卓)学习笔记
  6. 安装和卸载Android应用程序(apk包)
  7. Android高手进阶教程(五)之----Android(安卓)中LayoutInflater的
  8. android 自定义 permission 权限
  9. 在Android上本机运行的服务器

随机推荐

  1. Android设置透明、半透明等效果
  2. Android(安卓)设备管理器和有权查看使用
  3. BadgeView 与 RadioButton
  4. Android:AIDL简单使用
  5. Java、Android中的回调使用 Java回调方法
  6. Android(安卓)软键盘盖住输入框的问题
  7. android 手机滤镜
  8. android自定义属性之format介绍
  9. 自动批改android模拟器的imei的小程序 和
  10. android HorizontalScrollView实现滚动监