I am trying to pass a variable(long) from an activity to a service, I have the following In the activity:
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");
怎么说,我只能 t弄这一提醒性价值,任何想法? 一切帮助都会受到极大赞赏。