Merge "Don't call setListAdapter until adapter is ready."

This commit is contained in:
Makoto Onuki 2010-07-19 18:39:17 -07:00 committed by Android (Google) Code Review
commit 578402eb40
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,6 @@ public class MailboxListFragment extends ListFragment implements OnItemClickList
registerForContextMenu(listView);
mListAdapter = new MailboxesAdapter(mActivity);
setListAdapter(mListAdapter);
}
/**
@ -247,6 +246,7 @@ public class MailboxListFragment extends ListFragment implements OnItemClickList
if (cursor.isClosed()) return;
mListAdapter.changeCursor(cursor);
setListAdapter(mListAdapter);
updateMessageCount();
}
}

View File

@ -154,7 +154,6 @@ public class MessageListFragment extends ListFragment implements OnItemClickList
listView.setItemsCanFocus(false);
mListAdapter = new MessagesAdapter(mActivity, new Handler(), this);
setListAdapter(mListAdapter);
mListFooterView = getActivity().getLayoutInflater().inflate(
R.layout.message_list_item_footer, listView, false);
@ -861,6 +860,7 @@ public class MessageListFragment extends ListFragment implements OnItemClickList
// TODO changeCursor(null)??
mListAdapter.changeCursor(cursor);
setListAdapter(mListAdapter);
// changeCursor occurs the jumping of position in ListView, so it's need to restore
// the position;