我的片段中有这个扩展 ListFragment:
try {
FileInputStream in = getActivity().getApplicationContext().openFileInput("list");
ObjectInputStream i = new ObjectInputStream(in);
myData = (ArrayList<HashMap<String, MessageRecord>>) i.readObject();
if (myData != null) {
this.totalmessages = myData.size();
mySimpleAdapter = new MySimpleAdapter(getActivity().getApplicationContext(), myData, R.layout.menurow, mStrings, new int [] {R.id.ivDirection, R.id.tvMessage});
setListAdapter(mySimpleAdapter);
}
in.close();
}
我收到此错误:
Error: Fetch Message List
Error: java.lang.NullPointException
Error: ...FragmentMessages$1.run(FragmentMessages.java:307)
最后一行指向
mySimpleAdapter.notifyDataSetChanged();
请帮忙。