私はアラームから呼び出されている通知レシーバを持っています。通知救助者から開始されたアクティビティへの同意の取得
通知受信機は、新たな意図(活動)のためにデータをバンドルし、このようにそれを開始します。新しいアクティビティで
// Create an in intent to go to the new alarm video
Intent repeatingAlarmIntent = new Intent(context,RepeatingAlarmActivity.class);
// Bundle the videoID the alarm has the correct video to open
Bundle alarmExtras = new Bundle();
extras.putString("AlarmVidId", VideoId);
repeatingAlarmIntent.putExtras(alarmExtras);
// Set the flags for the alarm intent
repeatingAlarmIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
repeatingAlarmIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// Start the alarm intent
context.startActivity(repeatingAlarmIntent);
私はそれがnullのバンドルデータを取得しようとすると、これはどのようですバンドルされたデータを取得しようとしています:
public class RepeatingAlarmActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener {
String VideoId;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
VideoId= intent.getStringExtra("AlarmVidId");
私が間違っていることがわかりません。
ご協力いただきありがとうございます。
お世話になりました。ですから、変数名を両側で同じにする必要がありますか?私はVideoIdを両側で変更しましたが、それはまだ同じです。それはあなたが意味することですか? –
すべての変数名があなたのソリューションで試したものと同じになるように私は自分の質問を編集しました。私があなたを間違って理解した場合 –
私はそれを確認した –