summaryrefslogtreecommitdiffstats
path: root/chips
diff options
context:
space:
mode:
authorAlice Yang <alice@google.com>2013-04-26 14:39:18 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-04-26 14:39:18 -0700
commite91d9ea7c7013c42bb6f38ebe3832725e063ec52 (patch)
treeab989a58a37927754311fb8421b73f900930b71e /chips
parent2d3f2bcfdcd4593edd23b17868289d5a5c2f34da (diff)
parent31b46a1c8d707ca384c044e3e996ced2a2e52dd4 (diff)
downloadandroid_frameworks_ex-e91d9ea7c7013c42bb6f38ebe3832725e063ec52.tar.gz
android_frameworks_ex-e91d9ea7c7013c42bb6f38ebe3832725e063ec52.tar.bz2
android_frameworks_ex-e91d9ea7c7013c42bb6f38ebe3832725e063ec52.zip
am 31b46a1c: am f881a056: Prevent NPE in chips
* commit '31b46a1c8d707ca384c044e3e996ced2a2e52dd4': Prevent NPE in chips
Diffstat (limited to 'chips')
-rw-r--r--chips/src/com/android/ex/chips/RecipientEditTextView.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/chips/src/com/android/ex/chips/RecipientEditTextView.java b/chips/src/com/android/ex/chips/RecipientEditTextView.java
index 62a60b0..d2e5806 100644
--- a/chips/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java
@@ -417,6 +417,7 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
return sExcessTopPadding;
}
+ @Override
public <T extends ListAdapter & Filterable> void setAdapter(T adapter) {
super.setAdapter(adapter);
((BaseRecipientAdapter) adapter)
@@ -1459,6 +1460,7 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
return createAlternatesAdapter(currentChip);
}
+ @Override
protected void onPostExecute(final ListAdapter result) {
int line = getLayout().getLineForOffset(getChipStart(currentChip));
int bottom;
@@ -2490,10 +2492,12 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
addresses.add(createAddressText(chip.getEntry()));
}
}
+ final BaseRecipientAdapter adapter = (BaseRecipientAdapter) getAdapter();
+ if (adapter == null) {
+ return null;
+ }
RecipientAlternatesAdapter.getMatchingRecipients(getContext(), addresses,
- ((BaseRecipientAdapter) getAdapter()).getAccount(),
- new RecipientMatchCallback() {
-
+ adapter.getAccount(), new RecipientMatchCallback() {
@Override
public void matchesFound(Map<String, RecipientEntry> entries) {
final ArrayList<DrawableRecipientChip> replacements =