我正在保存我的数组列表并从saveinstancestate恢复方向更改,但恢复机制非常慢。 我通过评论在创建视图中恢复代码进行检查 - 在这种情况下,它可以快速工作,但如果我尝试恢复它挂起我的屏幕。 以下是我正在做的事情:
if (savedInstanceState != null) {
videoEntityList = (ArrayList<VideoListEntity>) savedInstanceState
.getSerializable("someExpensiveObject");
VideoListAdapter adapter = new VideoListAdapter( DashboardActivity.this, R.layout.dashboard_list_row,
videoEntityList , videoList, travelReady, s3, activity, width, height);
videoList.setAdapter(adapter);
}
并保存:
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
uiHelper.onSaveInstanceState(outState);
outState.putSerializable("someExpensiveObject", videoEntityList);
}
请帮助其他方法使其快速运作