4

このブロードキャストを送信することで、ショートカットを作成しています。

Intent shortcutIntent = new Intent(this, AuthenticationActivity.class);
    // create the broadcast
    final Intent intent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");

    intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
    intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, widget.name);
    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
                    Intent.ShortcutIconResource.fromContext(this, widget.resourceId));
    sendBroadcast(intent);

ブロードキャストがランチャーによって受信されたかどうかを知る方法はありますか? ショートカットが正常に作成されたことを示すトーストをユーザーに表示しますが、一部のランチャーはこれをサポートしていない可能性があります。

4

0 に答える 0