From 5ce80cadaa05c259ce8ab1abc498b6cfd4352f28 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 4 Feb 2010 01:49:56 +0000 Subject: [PATCH] Move FolderList initialization a bit earlier so as to not explode on reuse of the activity. Fixes issue 1164 --- src/com/fsck/k9/activity/FolderList.java | 40 ++++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/com/fsck/k9/activity/FolderList.java b/src/com/fsck/k9/activity/FolderList.java index 4604b93e5..14bc754e7 100644 --- a/src/com/fsck/k9/activity/FolderList.java +++ b/src/com/fsck/k9/activity/FolderList.java @@ -245,6 +245,26 @@ public class FolderList extends K9ListActivity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); + + mListView = getListView(); + mListView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_INSET); + mListView.setLongClickable(true); + mListView.setFastScrollEnabled(true); + mListView.setScrollingCacheEnabled(true); + mListView.setOnItemClickListener(new OnItemClickListener() + { + public void onItemClick(AdapterView parent, View v, int itemPosition, long id) + { + onOpenFolder(((FolderInfoHolder)mAdapter.getItem(id)).name); + } + }); + registerForContextMenu(mListView); + + mListView.setSaveEnabled(true); + + mInflater = getLayoutInflater(); + onNewIntent(getIntent()); } @@ -273,26 +293,6 @@ public class FolderList extends K9ListActivity private void initializeActivityView() { - requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); - - mListView = getListView(); - mListView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_INSET); - mListView.setLongClickable(true); - mListView.setFastScrollEnabled(true); - mListView.setScrollingCacheEnabled(true); - mListView.setOnItemClickListener(new OnItemClickListener() - { - public void onItemClick(AdapterView parent, View v, int itemPosition, long id) - { - onOpenFolder(((FolderInfoHolder)mAdapter.getItem(id)).name); - } - }); - registerForContextMenu(mListView); - - mListView.setSaveEnabled(true); - - mInflater = getLayoutInflater(); - mAdapter = new FolderListAdapter(); final Object previousData = getLastNonConfigurationInstance();