私はサービスへの活動から(長い)変数を渡すためにしようとしています、私は活動で を以下している:私のサービスで保留中のインテントからアクティビティからサービスにバンドルを渡すにはどうすればよいですか?
myIntent = new Intent(SetAlarm.this, Service.class);
pendingIntent = PendingIntent.getService(
SetAlarm.this,
(int)reminderId,
myIntent,
0
);
AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
bundle = new Bundle();
bundle.putLong("reminderId", reminderId);
myIntent.putExtras(bundle);
alarmManager.set(AlarmManager.RTC_WAKEUP, timeInMillisec, pendingIntent);
:どういうわけか
Bundle bundle = intent.getBundleExtra("bundle");
CurrentreminderId = (long)bundle.getLong("reminderId");
、私はちょうどこの思い出された価値、アイデアをつかむことができませんでしたか?どんな助けでも大いに感謝されます、ありがとうヒープ。
をおかげで、それは私が持っていたもののようなものが、花粉症だ、私は私が間違って行ってきたところを知っています!私はpendingIntentを設定した後、バンドルを入れて変数をバンドルに入れました!そして、それは私が保留中のものの前に置いた後、拾わなかった、それは働いた!とにかく、幸せなコーディングのすべての提案ありがとう! – Chungandroid