文章分类:移动开发创建应用程序的快捷方式如下: Action Java代码 private static final String ACTION_INSTALL_SHORTCUT = "com.android.launcher.action.INSTALL_SHORTCUT"; Java代码 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 Xml代码
java创建android快捷方式_Android创建快捷方式(shortcut)
最新推荐文章于 2022-09-30 16:37:22 发布