From 1dfa8ddc17a7f62f14d8435fd9712d1be0ebdf7e Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Tue, 25 Mar 2014 00:11:31 -0700 Subject: Fix NPE during activity recreation Bug: 13630676 Change-Id: I3b68d5f21a4b77eab5b5493dcde670ad08cdc372 --- src/com/android/dialer/DialtactsActivity.java | 4 +++- src/com/android/dialer/dialpad/DialpadFragment.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 363adda4a..32a22c9b4 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -970,7 +970,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void setDialButtonEnabled(boolean enabled) { - mDialButton.setEnabled(enabled); + if (mDialButton != null) { + mDialButton.setEnabled(enabled); + } } @Override diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 2d3c0ee32..36d5cf84b 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -1567,6 +1567,9 @@ public class DialpadFragment extends Fragment * Update the enabledness of the "Dial" and "Backspace" buttons if applicable. */ private void updateDialAndDeleteButtonEnabledState() { + if (getActivity() == null) { + return; + } final boolean digitsNotEmpty = !isDigitsEmpty(); mDelete.setEnabled(digitsNotEmpty); // On CDMA phones, if we're already on a call, we *always* enable the Dial button (since -- cgit v1.2.3