Fix NullPointerException when the user clicks on a "new mail"
notification. Resolves Issue 1001
This commit is contained in:
parent
81fd4749cc
commit
e1c686d40d
1 changed files with 56 additions and 41 deletions
|
@ -318,6 +318,10 @@ public class FolderList extends K9ListActivity
|
|||
initialFolder = null;
|
||||
mStartup = false;
|
||||
savedFolderName = savedInstanceState.getString(STATE_CURRENT_FOLDER);
|
||||
if (savedFolderName != null)
|
||||
{
|
||||
mSelectedContextFolder = mAdapter.getFolder(savedFolderName);
|
||||
}
|
||||
}
|
||||
|
||||
if (mStartup
|
||||
|
@ -327,6 +331,18 @@ public class FolderList extends K9ListActivity
|
|||
onOpenFolder(initialFolder, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
initializeActivityView();
|
||||
}
|
||||
}
|
||||
|
||||
/* There are two times when we might need to initialize the activity view
|
||||
* onCreate
|
||||
* OR
|
||||
* onResume if the initial onCreate opened a folder directly
|
||||
*/
|
||||
private void initializeActivityView()
|
||||
{
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
|
||||
|
@ -348,7 +364,7 @@ public class FolderList extends K9ListActivity
|
|||
* We manually save and restore the list's state because our adapter is
|
||||
* slow.
|
||||
*/
|
||||
mListView.setSaveEnabled(false);
|
||||
mListView.setSaveEnabled(true);
|
||||
|
||||
mInflater = getLayoutInflater();
|
||||
|
||||
|
@ -366,13 +382,9 @@ public class FolderList extends K9ListActivity
|
|||
|
||||
setTitle(mAccount.getDescription());
|
||||
|
||||
if (savedFolderName != null)
|
||||
{
|
||||
mSelectedContextFolder = mAdapter.getFolder(savedFolderName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override public Object onRetainNonConfigurationInstance()
|
||||
{
|
||||
return mAdapter.mFolders;
|
||||
|
@ -393,6 +405,9 @@ public class FolderList extends K9ListActivity
|
|||
{
|
||||
super.onResume();
|
||||
|
||||
if (mAdapter == null)
|
||||
initializeActivityView();
|
||||
|
||||
MessagingController.getInstance(getApplication()).addListener(mAdapter.mListener);
|
||||
mAccount.refresh(Preferences.getPreferences(this));
|
||||
MessagingController.getInstance(getApplication()).getAccountUnreadCount(this, mAccount, mAdapter.mListener);
|
||||
|
|
Loading…
Reference in a new issue