I want to pass a new, but different, Intent to an Activity. How do you differentiate between the new Intent and previous Intents? What kind of code goes into onNewIntent()?
If you don't want your activity to re-use the new intent in every subsequent onResume()
I would recommend to store the intent in an instance field instead of via setIntent(intent)
.
That way you can reset that instance field to null once you have consumed the intent without throwing away the original launch intent.
More details in my answer here: https://stackoverflow.com/a/21261404/621690
setIntent(Intent)
has been described as a mistake by an Android Framework Engineer:
https://groups.google.com/forum/#!topic/android-developers/vrLdM5mKeoY