summaryrefslogtreecommitdiff
path: root/src/com/android
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-05-18 18:21:01 -0700
committerYorke Lee <yorkelee@google.com>2014-05-18 18:22:22 -0700
commitddfb00180a56f254857289a1b9be51556b2ac0f9 (patch)
tree0d3211ac27b6deda61496c58a6721e9593b1405c /src/com/android
parente026fac8868f7393ccab2ce4ceb8faa9bd2530b2 (diff)
Fix NPE in onTextChanged
Always initialize mVoiceSearchButton in onCreate to ensure that it is never null Change-Id: Ic478ae136f7bcbb28a49efce0f4ce2481dcd4945
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/dialer/DialtactsActivity.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 2b66355cf..3b68db97b 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -336,6 +336,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
actionBarView.setPreImeKeyListener(mSearchEditTextLayoutListener);
mSearchIcon = actionBarView.findViewById(R.id.search_magnifying_glass);
+ mVoiceSearchButton = actionBarView.findViewById(R.id.voice_search_button);
mSearchView = (EditText) actionBarView.findViewById(R.id.search_view);
mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener);
@@ -658,7 +659,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
}
private void prepareVoiceSearchButton() {
- mVoiceSearchButton = getActionBar().getCustomView().findViewById(R.id.voice_search_button);
final Intent voiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
if (canIntentBeHandled(voiceIntent)) {
mVoiceSearchButton.setVisibility(View.VISIBLE);