Diffrence between getExtras().getSerializable() an

2019-06-25 12:20发布

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)?

1条回答
别忘想泡老子
2楼-- · 2019-06-25 13:01

Both do the same thing. getSerializableExtra is a method of Intent (you have to call it on Intent instance) getSerializable is a method of Bundle (you have to call it on a Bundle instance)

查看更多
登录 后发表回答