如何从AlarmManager启动的服务中找回意图?
|
我使用警报服务跳转到服务。服务启动时,我能否找回意图(我想从意图中获取数据)?
我的代码如下
PendingIntent sender=PendingIntent.getService(this, 0, myIntent, 0);
am = (AlarmManager)getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, c.getTimeInMillis(), sender);
如何从服务中获得“ myIntent”?没有像getIntent()这样的方法
在服役。我试图在onBind(Intent intent)中使用该intent,但这不是我想要的。
我想我解决了这个问题。
PendingIntent sender = PendingIntent.getService(this,0,myIntent,
PendingIntent.FLAG_ONE_SHOT);
问题出在旗帜上。现在我可以将自己的意图重新回到服务班上
OnStartCommand(Intent,int,int)
没有找到相关结果
已邀请:
1 个回复
擅香
(如果是
,则也传递给
)。