I am having confusion between
intent.getSerializableExtra (String name)
and
intent.getExtras().getSerializable (String key)
Can we use them interchangeably, or both of them have their own specific scenarios?
If so, what are those scenarios when we can use getSerializableExtra (String name)
and when we can use getExtras().getSerializable (String key)
?
Both do the same thing.
getSerializableExtra
is a method ofIntent
(you have to call it onIntent
instance)getSerializable
is a method ofBundle
(you have to call it on aBundle
instance)