从一个活动到其他通过数组列表 [英] pass arraylist from one activity to other

查看:108
本文介绍了从一个活动到其他通过数组列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何传递的ArrayList 从一个活动到另一个活动?

How can I pass ArrayList from one activity to other activity?

推荐答案

这取决于ArrayList的类型

It depends on the type of arraylist

  • putIntegerArrayListExtra(字符串名称,ArrayList的<整数GT;值)

putParcelableArrayListExtra(字符串名称,ArrayList的&LT ;?延伸Parcelable>值)

putStringArrayListExtra(字符串名称,ArrayList的<字符串>值)

putCharSequenceArrayListExtra(字符串名称,ArrayList的< CharSequence的>值)

然后就可以通过更换从你读下一个活动 GET 以关键字为参数,如

Then you can read from you next activity by replacing put with get with key string as argument,eg

myIntent.getStringArrayListExtra("arrayPeople");

这篇关于从一个活动到其他通过数组列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆