Found after examined the related API, use the PendingIntent. GetActivity (mContext, 0, mActivity, 0); After the Notification is opened, the target Activity cannot retrieve any additional data from getIntent(). Set the flag of the getActivity function to either pendingintent.flag_update_current or pendingintent.flag_cancel_current according to the API.
Also put a PendingIntent, getActivity function can be used in several flag value meaning:
0:
Default value, if the described PendingIntent already exists, then keep it without change.
FLAG_CANCEL_CURRENT:
For use with a Flag with the getActivity (Context, int, Intent, int) code>,
getBroadcast (Context, int, Intent, int) code>, and
getService (Context, int, Intent, int) code> : if the described PendingIntent already exists, the current one is canceled before generating a new one. You can use this to retrieve a new PendingIntent when you are only changing the extra data in the Intent; By canceling the previous pending intent, this ensures that only entities given the new data will be able to launch it. If this assurance is not an issue, consider
FLAT_Update_current
Constant Value: 268435456 (0 x10000000)
FLAG_NO_CREATE:
For use with a Flag with the getActivity (Context, int, Intent, int) code>,
getBroadcast (Context, int, Intent, int) code>, and
getService (Context, int, Intent, int) code> : if the described PendingIntent does not already exist, then simply return null instead of creating it.
Constant Value: 536870912 (0 x20000000)
FLAG_ONE_SHOT:
For use with a Flag with the FLAG_UPDATE_CURRENT: For use with a Flag with the Constant Value: 134217728 (0 x08000000) getActivity (Context, int, Intent, int) code>,
getBroadcast (Context, int, Intent, int) code>, and
getService (Context, int, Intent, int) code> : This PendingIntent can only be used once. If set, after
send()
getActivity (Context, int, Intent, int) code>,
getBroadcast (Context, int, Intent, int) code>, and
getService (Context, int, Intent, int) code> : if the described PendingIntent already exists, then keep it but its replace its extra data with what is in this new Intent. This can be used if you are creating intents where only the extras change, and don't care that any entities that received your previous PendingIntent will be able to launch it with your new extras even if they are not explicitly given to it.
Read More:
- XML file should have root tag (extra content at the end of the document in file error)
- Solve the problem that Windows 7 cannot be updated automatically_ Prompt error code 80246008
- The intent solution cannot be updated in onrestart method
- The reason and solution of Android intent value not updated
- Vue element UI uses this. $notify is not a function problem resolution using the notification box
- Solve the problem that data cannot be input in idea console
- Content rendering error: a solution to the problem of zero Download document cannot be opened
- Error: ~ /. Vuerc may be updated. Please delete it and re run vuercli in manual mode
- [MySQL] [serialize] [error record] after modifying data, no data will be returned (in fact, MySQL does not support it)
- Record an error that the Tomcat resource publication cannot be updated:
- Error reading JSON file: json.decoder.JSONDecodeError : Extra data: line 6 column 2 (char 1329)
- How to solve the problem of “blocked loading mixed active content” in Firefox
- To solve the problem of failed to load: data in HTML5 game running rmmv locally/ actors.json problem
- About content type ‘multipart / form data…’ not support
- WCF-HTTP Error 404.17 – Not Found, The requested content appears to be script and will not be served…
- The element “extra pin The solution of “in normal of part” warning
- 8024401c cannot be updated, update failed, update error
- Data analysis to obtain Yahoo stock data: some problems are encountered when using panda datareader (cannot import name ‘is_ list_ Like ‘problem)
- Solve the problem of using the default content type of JMeter
- The problem of Chinese garbled data in MySQL