创造和卸载快捷方式
创建和卸载快捷方式?卸载快捷方式:?写道/*** 卸载快捷方式*/void deleteShortcut() {Intent shortcut ne
创建和卸载快捷方式
?卸载快捷方式:
?写道/**
* 卸载快捷方式
*/
void deleteShortcut() {
Intent shortcut = new Intent("com.android.launcher.action.UNINSTALL_SHORTCUT");
shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, "卸载快捷方式"); //指定要卸载的快捷方式的名称
String action = "com.android.action.test";
String appClass = this.getPackageName() + "." + this.getLocalClassName();
ComponentName comp = new ComponentName(this.getPackageName(), appClass);
shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(action).setComponent(comp));
sendBroadcast(shortcut);
}?需要权限:<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" />??