设置的ArrayList< HashMap的<字符串对象> >值 [英] set ArrayList < HashMap < String, Object > > value

查看:258
本文介绍了设置的ArrayList< HashMap的<字符串对象> >值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要添加像的ArrayList&LT值; HashMap的<弦乐,对象>> 来的意图,并通过对活动通过broadc。在code是这样的:

I want to add the value like ArrayList<HashMap<String, Object>> to intent, and pass on Activity through broadc. The code like this:

ArrayList<HashMap<String, Object>> listItem = new ArrayList<HashMap<String, Object>>();
intent1.putParcelableArrayListExtra("listItem", listItem);

但它有错误:

该方法 putParcelableArrayListExtra(字符串,ArrayList的&LT ;?延伸Parcelable&GT;)中的类型意图是不适用的参数(字符串,ArrayList的&LT; HashMap的&LT;弦乐,对象&gt;&GT;)

The method putParcelableArrayListExtra(String, ArrayList<? extends Parcelable>) in the type Intent is not applicable for the arguments (String, ArrayList<HashMap<String,Object>>)

如何使用 putParcelableArrayListExtra 具体一点吗?通过实现Parcelable接口,可以将其退回的ArrayList&LT; HashMap的&LT;字符串对象&gt; &GT; 对象

How to use putParcelableArrayListExtra specific? Through realizing Parcelable interface, can it return the ArrayList < HashMap < String, Object > > Object?

推荐答案

由于ArrayList的实现Serializable,你没有做什么特别的饲料它

Since ArrayList implements Serializable, you don't have to do anything special to feed it to

只是使用 Intent.putExtra()把价值和使用 getSerializableExtra()来获得ArrayList的背到下一个活动。

Just Use Intent.putExtra() to put the values and use getSerializableExtra() to get the arraylist back to next activity.

这篇关于设置的ArrayList&LT; HashMap的&LT;字符串对象&gt; &GT;值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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