Intent.putExtras not consistent

此生再无相见时 提交于 2019-12-06 04:33:38
CommonsWare

Your very question was asked six hours ago.

If you will have multiple PendingIntents at the same time with different extras, you will need to vary something else in the Intents, like the action string or the Uri, as described in the linked-to issue above.

If you will only have one PendingIntent at a time, but your extra may vary, just use FLAG_UPDATE_CURRENT in your call to getBroadcast().

Multiple PendingIntents:

Intent notificationIntent = new Intent(this, Oconf.class);
notificationIntent.setData(Uri.parse("text"));

Then, onNewIntent(Intent intent):

String text = intent.getData().toString();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!