开发者

Pass complex object though intent

开发者 https://www.devze.com 2023-03-03 23:13 出处:网络
I need to pass a list of cookies from开发者_如何学Go one activity to the other using an Intent. How would one go about achieving this?

I need to pass a list of cookies from开发者_如何学Go one activity to the other using an Intent. How would one go about achieving this?

Thanks.


Using Intent.putExtra(String name, String[] value) would be the easiest way to pass a list of cookies. There are other putExtra signatures as well, depending on how you currently have your list implemented. On the other side, you would use getExtras() to get values. If for some reason, you had a more complex setup, you could create a Cookie class which extends Parcelable.


Just pass it along in the setExtra() method of the Intent class.

Hope it helped, JQCorreia

0

精彩评论

暂无评论...
验证码 换一张
取 消