我如何从额外意图中清除价值观?
活动:
@Override
public void onCreate(Bundle savedInstanceState) {
......
Intent intent = new Intent(this, MyBroadcastReceiver .class);
intent.putExtra("valueOne", "valOne");
intent.putExtra("valueTwo", true);
intent.putExtra("valueThree", 1);
PendingIntent pendingIntent = PendingIntent.getBroadcast(
this.getApplicationContext(), 234324243, intent, 0);
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()
+ (5 * 1000), pendingIntent);
......
iii
广播:
@Override
public void onReceive(Context context, Intent intent) {
......
String valueOne= intent.getStringExtra("valueOne");
Boolean valueTwo= intent.getBooleanExtra("valueTwo", false);
Integer valueThree= intent.getIntExtra("valueThree", 0);
// Log.i("info", valueOne) >> valOne
// Log.i("info", valueTwo.toString()) >> false
// Log.i("info", valueThree.toString()) >> 1
......
iii
如果我改变活动价值并再次提出申请,那么我就在一开始就获得同样的价值。 我试图从我的电话/病毒机器、清洁项目中删除灯,但问题依然存在:
谁帮助我?