1
     Intent shortcutIntent = new Intent(getApplicationContext(),    HomeScreen.class);      
        shortcutIntent.setAction(Intent.ACTION_MAIN);

        Intent addIntent = new Intent();
        addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
        addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "AIMS ICD");
        addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,Intent.ShortcutIconResource.fromContext(getApplicationContext(), R.drawable.aims));
        addIntent.putExtra("duplicate", false);
        addIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
        getApplicationContext().sendBroadcast(addIntent);

此代码工作正常,但在创建快捷方式后此显示消息“已创建快捷方式 AIMS ICD”我不想要此消息

4

1 回答 1

2

抱歉,无法阻止默认系统 Toast 的出现(来源:Dianne,Google 员工

于 2013-01-24T11:03:57.193 回答