diff options
Diffstat (limited to 'src/com/android')
| -rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 4b4e21e1e..cecd76001 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -509,6 +509,11 @@ public class CallLogFragment extends Fragment implements CallLogQueryHandler.Lis /** Requests updates to the data to be shown. */ private void refreshData() { + if (!isAdded() || getActivity() == null) { + // Fragment is not attached to the activity nothing to do + return; + } + // Prevent unnecessary refresh. if (mRefreshDataRequired) { // Mark all entries in the contact info cache as out of date, so they will be looked up @@ -550,8 +555,13 @@ public class CallLogFragment extends Fragment implements CallLogQueryHandler.Lis if (!onEntry) { mCallLogQueryHandler.markMissedCallsAsRead(); } - CallLogNotificationsHelper.removeMissedCallNotifications(getActivity()); - CallLogNotificationsHelper.updateVoicemailNotifications(getActivity()); + + Activity activity = getActivity(); + if (activity == null) { + return; + } + CallLogNotificationsHelper.removeMissedCallNotifications(activity); + CallLogNotificationsHelper.updateVoicemailNotifications(activity); } } |
