Reputation: 3592
Is it possible to retrieve the Intent which came in onNewIntent on a later timing?
For example, lets assume that I have a LiveData Observer in my Activity or Fragment, and when onChange is called I want to check if there was a new Intent earlier, with some content in it which is different then the original Intent that launched the Activity?
I don't want to keep a class member variable which holds the new Intent..
Does such thing possible?
Upvotes: 0
Views: 86
Reputation: 1007584
I don't want to keep a class member variable which holds the new Intent.
You do not have much of a choice.
Is it possible to retrieve the Intent which came in onNewIntent on a later timing?
Only if you override onNewIntent()
and store the Intent
that you get somewhere.
when onChange is called I want to check if there was a new Intent earlier, with some content in it which is different then the original Intent that launched the Activity?
For this, you could override onNewIntent()
, compare the content with that from the original Intent
(getIntent()
), store the results of that comparison in a class field, and then reference that class field in onChange
.
Upvotes: 0