Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我可以更改Pending帐篷中的值吗?_Android_Android Intent_Alarmmanager_Android Pendingintent - Fatal编程技术网

Android 我可以更改Pending帐篷中的值吗?

Android 我可以更改Pending帐篷中的值吗?,android,android-intent,alarmmanager,android-pendingintent,Android,Android Intent,Alarmmanager,Android Pendingintent,我有一个报警管理器,每隔几分钟就会触发一个待定的意图。我可以通过指定的intent类在的OnReceive方法中以某种方式更改此挂起的intent吗。 而且,是否有可能将这个意图从一个没有直接联系的类改变为这个意图 我查找了它,但到目前为止还没有找到任何有用的信息。使用以下代码用新的附加值更新PendingEvent Intent i = new Intent(context, Alarm.class); i.putExtra("position", tag); Pendin

我有一个报警管理器,每隔几分钟就会触发一个待定的意图。我可以通过指定的intent类在的
OnReceive
方法中以某种方式更改此挂起的intent吗。 而且,是否有可能将这个意图从一个没有直接联系的类改变为这个意图


我查找了它,但到目前为止还没有找到任何有用的信息。

使用以下代码用新的附加值更新PendingEvent

 Intent i = new Intent(context, Alarm.class);    
 i.putExtra("position", tag);   
 PendingIntent pi = PendingIntent.getBroadcast(context, tag, i,
    PendingIntent.FLAG_UPDATE_CURRENT);

谢谢,我的错误是使用了方法调用提供的意图。愚蠢的错误。但是如何在
onReceive
调用之外更改此挂起的意图?在那里,我没有
上下文
对象来创建我的意图。