android 删除桌面的快捷键shortcut
2010-01-15 10:55 1340人阅读 评论(2) 收藏 举报
androiddeleteactionapplicationgooglestring
只能删除shortcut类型的,不能删除Application的icon类型的,比如删除api demo 的 shortcut private String DELETE_ACTION = "com.android.launcher.action.UNINSTALL_SHORTCUT";
Intent intent = new Intent(DELETE_ACTION);
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Sample");
ComponentName comp = new ComponentName("com.example.android.apis",
"com.example.android.apis.app.LauncherShortcuts");
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent()
.setComponent(comp).setAction("android.intent.action.MAIN"));
sendBroadcast(intent);
加permission
在数据库中红色是有效的数据intent. putExtra("",new Intent(
"android.intent.action.VIEW").setData(Uri.parse("http://www.google.com/"))
9 Google http://www.google.com/#Intent;action=android.intent.action.VIEW;S.com.android.browser.application_id=-[***********];
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Google");
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(
"android.intent.action.VIEW").setData(Uri.parse("http://www.google.com/")));
android 删除桌面的快捷键shortcut
2010-01-15 10:55 1340人阅读 评论(2) 收藏 举报
androiddeleteactionapplicationgooglestring
只能删除shortcut类型的,不能删除Application的icon类型的,比如删除api demo 的 shortcut private String DELETE_ACTION = "com.android.launcher.action.UNINSTALL_SHORTCUT";
Intent intent = new Intent(DELETE_ACTION);
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Sample");
ComponentName comp = new ComponentName("com.example.android.apis",
"com.example.android.apis.app.LauncherShortcuts");
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent()
.setComponent(comp).setAction("android.intent.action.MAIN"));
sendBroadcast(intent);
加permission
在数据库中红色是有效的数据intent. putExtra("",new Intent(
"android.intent.action.VIEW").setData(Uri.parse("http://www.google.com/"))
9 Google http://www.google.com/#Intent;action=android.intent.action.VIEW;S.com.android.browser.application_id=-[***********];
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Google");
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(
"android.intent.action.VIEW").setData(Uri.parse("http://www.google.com/")));