在savedInstanceState上获取ClassCastException 我需要在调用恢复功能时获取位置ArrayList
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putSerializable("places", places);
}
private void restore(Bundle savedInstanceState) {
if (savedInstanceState != null) {
places = (ArrayList<HashMap<String,String>>) savedInstanceState.getSerializable("places");
}
}
从onCreate调用恢复时获取java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList