私のアプリケーションは android.intent.action.CREATE_SHORTCUT ブロードキャストをリッスンします。私のコードでは、次のような文字列エクストラを含むショートカットを作成しています:
Intent shortcutIntent = new Intent(Intent.ACTION_VIEW);
shortcutIntent.setClassName("com.some.name","com.some.name.Activity");
shortcutIntent.putExtra("stringid", "some string value");
ShortcutIconResource iconResource = Intent.ShortcutIconResource.fromContext(ShortcutActivity.this,iconIdentifier);
Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, channelName);
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
setResult(RESULT_OK, intent);
ショートカットは機能しますが、電話機を再起動するたびにエクストラが失われます(nullが返され、ログを確認してデバッグしました)。これは正常な動作ですか?私はそれを間違っていますか?エクストラをアクティビティに渡す必要があります。