mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-23 16:18:50 -05:00
Don't crash when MessageList is started with no intent extras
This commit is contained in:
parent
5fc39e6719
commit
85e7d4fa12
@ -213,7 +213,10 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
// Enable gesture detection for MessageLists
|
||||
setupGestureDetector(this);
|
||||
|
||||
decodeExtras(getIntent());
|
||||
if (!decodeExtras(getIntent())) {
|
||||
return;
|
||||
}
|
||||
|
||||
findFragments();
|
||||
initializeDisplayMode(savedInstanceState);
|
||||
initializeLayout();
|
||||
@ -244,7 +247,10 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
mSearch = null;
|
||||
mFolderName = null;
|
||||
|
||||
decodeExtras(intent);
|
||||
if (!decodeExtras(intent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
initializeDisplayMode(null);
|
||||
initializeFragments();
|
||||
displayViews();
|
||||
@ -361,7 +367,7 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
}
|
||||
}
|
||||
|
||||
private void decodeExtras(Intent intent) {
|
||||
private boolean decodeExtras(Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (Intent.ACTION_VIEW.equals(action)) {
|
||||
Uri uri = intent.getData();
|
||||
@ -433,7 +439,7 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
String folderName = intent.getStringExtra("folder");
|
||||
|
||||
mSearch = new LocalSearch(folderName);
|
||||
mSearch.addAccountUuid(accountUuid);
|
||||
mSearch.addAccountUuid((accountUuid == null) ? "invalid" : accountUuid);
|
||||
if (folderName != null) {
|
||||
mSearch.addAllowedFolder(folderName);
|
||||
}
|
||||
@ -459,7 +465,7 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
if (mSingleAccountMode && (mAccount == null || !mAccount.isAvailable(this))) {
|
||||
Log.i(K9.LOG_TAG, "not opening MessageList of unavailable account");
|
||||
onAccountUnavailable();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mSingleFolderMode) {
|
||||
@ -468,6 +474,8 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
|
||||
// now we know if we are in single account mode and need a subtitle
|
||||
mActionBarSubTitle.setVisibility((!mSingleFolderMode) ? View.GONE : View.VISIBLE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user