summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiogo Ferreira <diogo@underdev.org>2016-10-03 15:07:27 +0100
committerDiogo Ferreira <diogo@underdev.org>2016-10-03 15:07:27 +0100
commitba24a30348925078e75f138aae5dfa4d603d059e (patch)
tree0821989c250bfc2756876a79422aac1ae05ec888
parent2a2572a719debd671806526d87b55f40219ad72e (diff)
downloadandroid_packages_apps_Dialer-ba24a30348925078e75f138aae5dfa4d603d059e.tar.gz
android_packages_apps_Dialer-ba24a30348925078e75f138aae5dfa4d603d059e.tar.bz2
android_packages_apps_Dialer-ba24a30348925078e75f138aae5dfa4d603d059e.zip
dialer: search: Don't attempt to get resources on a detached fragment
During the activity lifecycle, the user might have used the search fragment but then place the call via other means and in that case the search fragment will be detached. It does, however, still try to set itself up and in the process attempts to obtain context-bound items such as Resources and the Dialer app crashes. Change-Id: Id3b9f376e282f4f8a04960eb3c4a5eac0d2ea9ad Ticket: FEIJAO-1173
-rw-r--r--src/com/android/dialer/list/SearchFragment.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java
index 5b8552c7e..9c597d504 100644
--- a/src/com/android/dialer/list/SearchFragment.java
+++ b/src/com/android/dialer/list/SearchFragment.java
@@ -556,7 +556,7 @@ public class SearchFragment extends PhoneNumberPickerFragment
public void setupEmptyView() {
DialtactsActivity dialActivity = (DialtactsActivity) mActivity;
- if (mEmptyView != null && dialActivity != null) {
+ if (mEmptyView != null && dialActivity != null && isAdded()) {
ContactEntryListAdapter adapter = getAdapter();
Resources r = getResources();
mEmptyView.setWidth(dialActivity.getDialpadWidth());