【发布时间】:2021-10-07 19:27:17
【问题描述】:
我有一个在通知点击时触发的广播接收器。我正在传递一个字符串以通知广播接收器。字符串的值每次都不同,但是当我测试我的应用程序时,我只能看到我第一次单击通知时收到的值。现在,尽管传递了新值,但我从通知到广播接收器的每个值都是相同的。
我的代码:
//Creating notification
Intent snoozeIntent = new Intent(getApplicationContext(), ServiceLauncherBroadcast.class);
snoozeIntent.putExtra("order_id", orderId);
//In the broadcast receiver
startWorkManager(intent.getStringExtra("order_id")
//Manifest
<receiver android:name = ".utils.ServiceLauncherBroadcast" />
【问题讨论】: