From ff1769fb36ae7d4968672d5326b48310b489bc99 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Thu, 16 Apr 2015 15:10:32 -0700 Subject: Remove use of private isResumed API Change-Id: I3ad2277b4822d219bd53b35914befb4a4d52b45b --- src/com/android/dialer/calllog/CallLogActivity.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/com/android/dialer/calllog/CallLogActivity.java') diff --git a/src/com/android/dialer/calllog/CallLogActivity.java b/src/com/android/dialer/calllog/CallLogActivity.java index 33e72bc12..c4e16a1b7 100644 --- a/src/com/android/dialer/calllog/CallLogActivity.java +++ b/src/com/android/dialer/calllog/CallLogActivity.java @@ -66,6 +66,8 @@ public class CallLogActivity extends Activity implements CallLogQueryHandler.Lis private boolean mHasActiveVoicemailProvider; + private boolean mIsResumed; + private final Runnable mWaitForVoicemailTimeoutRunnable = new Runnable() { @Override public void run() { @@ -188,6 +190,7 @@ public class CallLogActivity extends Activity implements CallLogQueryHandler.Lis @Override protected void onResume() { + mIsResumed = true; super.onResume(); CallLogQueryHandler callLogQueryHandler = new CallLogQueryHandler(this.getContentResolver(), this); @@ -195,6 +198,12 @@ public class CallLogActivity extends Activity implements CallLogQueryHandler.Lis sendScreenViewForChildFragment(mViewPager.getCurrentItem()); } + @Override + protected void onPause() { + mIsResumed = false; + super.onPause(); + } + @Override public boolean onCreateOptionsMenu(Menu menu) { final MenuInflater inflater = getMenuInflater(); @@ -264,7 +273,7 @@ public class CallLogActivity extends Activity implements CallLogQueryHandler.Lis @Override public void onPageSelected(int position) { - if (isResumed()) { + if (mIsResumed) { sendScreenViewForChildFragment(position); } mViewPagerTabs.onPageSelected(position); -- cgit v1.2.3