【发布时间】:2012-02-02 06:51:13
【问题描述】:
我在数组列表中有 hashtbles。
List<Hashtable<String, String>> info = new ArrayList<Hashtable<String, String>>();
Hashtable<String, String> hm = new Hashtable<String, String>();
// Put elements to the map
hm.put("Read_Flag", s1);
hm.put("sms_received_id", s2);
hm.put("Sender_Id", s3);
hm.put("Sender_Name", s4);
hm.put("Patient_Name", s5);
hm.put("Received_Date", s6);
hm.put("Received_Text", s7);
hm.put("Received_Text_Full", s8);
hm.put("AttachmentFlag", s9);
// Get a set of the entries
Set<?> set = hm.entrySet();
// Get an iterator
Iterator<?> it = set.iterator();
// Display elements
while(it.hasNext()) {
Map.Entry me = (Map.Entry)it.next();
// System.out.print(me.getKey() + ": ");
// System.out.println(me.getValue());
}
//System.out.println(hm);
info.add(hm);
这里的信息包含我的哈希表。我怎样才能把这个“信息”对象放到其他类/意图中?
谢谢...
【问题讨论】:
-
可能只有我,但我不明白你的要求。也许一个例子或更多解释会有所帮助。
-
不确定您的意思?请你把它简单一点。
-
如何在其他类中获取此“信息”对象?
-
@HaPPy 使用 Serializable 或 Parcelable。
-
@LalitPoptani 请给我一个示例代码
标签: java android arraylist hashtable