我覺得不能,因爲麪包是由發射出
private void addShortcut(){
Intent shortcutIntent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
// Shortcut name
shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name));
shortcutIntent.putExtra("duplicate", false);
ComponentName comp = new ComponentName(this.getPackageName(), "."+this.getLocalClassName());
shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(Intent.ACTION_MAIN).setComponent(comp));
// Shortcut icon
ShortcutIconResource iconRes = Intent.ShortcutIconResource.fromContext(this, R.drawable.icon);
shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconRes);
sendBroadcast(shortcutIntent);
}
private void delShortcut(){
Intent shortcut = new Intent("com.android.launcher.action.UNINSTALL_SHORTCUT");
// Shortcut adı
shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name));
String appClass = this.getPackageName() + "." +this.getLocalClassName();
ComponentName comp = new ComponentName(this.getPackageName(), appClass);
shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(Intent.ACTION_MAIN).setComponent(comp));
sendBroadcast(shortcut);
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
delShortcut();
addShortcut();
權限,這是一個不同於你的應用程序。
雖然我可能是錯的。
無論如何,這不是您的應用程序創建的敬酒,所以它是不太可能的,你可以隱藏它。
但是沒有烤麪包怎麼辦? –
我不記得whatsapp把自己的快捷鍵。在哪些情況下會創建快捷方式?還有,你檢查過哪些發射器?也許別人會表示敬酒。我現在嘗試與某人進行對話並選擇創建聯繫人的快捷方式,並且我可以清楚地看到敬酒。我使用Nova Launcher。 –