An Intent
is a passive data structure that carries information from one Activity
to another. An Intent
is also capable of holding data in the form of name-value pairs (via putExtra()
).
But while overriding the onCreate()
method we pass a Bundle
as the parameter, which ultimately also holds values in the form of name-value pairs and is able to store information with the help of onSaveInstanceState()
.
In such a scenario why do we need both and what differentiates the two?
I suppose I have led you guys into a misbelief that I have misunderstood what an Intent
is:
When I said "An Intent
is a passive data structure that carries information from one Activity
to another", what I intended to point out was that even an Intent
can carry information (other than the context and action description) with the help of putExtra()
method. Why do we need to use a Bundle
then?