开发者

Pass complex object though intent

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜