summaryrefslogtreecommitdiffstats
path: root/core/java/android/accounts
diff options
context:
space:
mode:
authorCarlos Valdivia <carlosvaldivia@google.com>2013-04-19 01:07:12 -0700
committerCarlos Valdivia <carlosvaldivia@google.com>2013-04-19 02:57:42 -0700
commit1b64c9d31536ec8b4a89b1b05bf493b50a2a6c4e (patch)
tree130fa5f38538028746d0ca220bb05b8076496a71 /core/java/android/accounts
parent4e0eb22fdf56b8f3fd1bff09c4064b35b80751c1 (diff)
downloadframeworks_base-1b64c9d31536ec8b4a89b1b05bf493b50a2a6c4e.zip
frameworks_base-1b64c9d31536ec8b4a89b1b05bf493b50a2a6c4e.tar.gz
frameworks_base-1b64c9d31536ec8b4a89b1b05bf493b50a2a6c4e.tar.bz2
Fix NPE when restarting ChooseTypeAndAccountActiivty.
Note that this change still leaves things in an imperfect state. Now instead of ANR with an NPE it will reshow the Choose account activity and then on the second back, it will go away. So the user isn't hosed. But it is still a sloppy experience. Basically the bug fix reveals another not quite as bad bug (see https://b/8661942). Bug: 8151602 Change-Id: I44b188f5940d464c2dd81dd0b6b7cae3c189becd
Diffstat (limited to 'core/java/android/accounts')
-rw-r--r--core/java/android/accounts/ChooseTypeAndAccountActivity.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/accounts/ChooseTypeAndAccountActivity.java b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
index 2aba163..58eb66f 100644
--- a/core/java/android/accounts/ChooseTypeAndAccountActivity.java
+++ b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
@@ -34,13 +34,11 @@ import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
-import android.widget.Toast;
import com.android.internal.R;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
@@ -110,6 +108,7 @@ public class ChooseTypeAndAccountActivity extends Activity
private static final String KEY_INSTANCE_STATE_EXISTING_ACCOUNTS = "existingAccounts";
private static final String KEY_INSTANCE_STATE_SELECTED_ACCOUNT_NAME = "selectedAccountName";
private static final String KEY_INSTANCE_STATE_SELECTED_ADD_ACCOUNT = "selectedAddAccount";
+ private static final String KEY_INSTANCE_STATE_ACCOUNT_LIST = "accountList";
private static final int SELECTED_ITEM_NONE = -1;
@@ -169,6 +168,7 @@ public class ChooseTypeAndAccountActivity extends Activity
mSelectedAddNewAccount = savedInstanceState.getBoolean(
KEY_INSTANCE_STATE_SELECTED_ADD_ACCOUNT, false);
+ mAccounts = savedInstanceState.getParcelableArrayList(KEY_INSTANCE_STATE_ACCOUNT_LIST);
} else {
mPendingRequest = REQUEST_NULL;
mExistingAccounts = null;
@@ -266,6 +266,7 @@ public class ChooseTypeAndAccountActivity extends Activity
mAccounts.get(mSelectedItemIndex).name);
}
}
+ outState.putParcelableArrayList(KEY_INSTANCE_STATE_ACCOUNT_LIST, mAccounts);
}
public void onCancelButtonClicked(View view) {