...
HashMap<String, String> contactsMap = new HashMap<>();
contactsMap.put("key1" , "value1");
contactsMap.put("key2" , "value2");
ArrayList<HashMap> list = new ArrayList<>();
list.add(contactsMap);
Bundle b = new Bundle();
b.putSerializable("HASHMAP", list);
ArrayList<HashMap> hashmapList = (ArrayList<HashMap>) b.getSerializable("HASHMAP");
HashMap<String, String> map = hashmapList.get(0);
for (Map.Entry<String, String> entry : map.entrySet()) {
System.out.println(entry.getKey()+" : "+entry.getValue());
}
あなたが同じデータを取得します。ムービーモデルクラスがシリアライズ可能であることを確認してください。
[SerializableオブジェクトからArraylist of Hashmap]の可能な複製物(http://stackoverflow.com/questions/17233566/serializable-object-to-arraylist-of-hashmap) –
あなたは構造全体を作ることを試みることを歓迎します'Serializable'。つまり、私はこれがセーブされたインスタンス状態 'Bundle'に入るべきものであると懐疑的です。 – CommonsWare
@BertrandMartelありがとう – Rangtian