Merge "Fix summary lifecycle" into nyc-dev
am: 6e51591
* commit '6e5159185388ed97c5b1a8648c1c6f2396d124a2':
Fix summary lifecycle
Change-Id: If5eb2ce64f152d37fc5b60c74ea2e2f28bd50a4f
This commit is contained in:
@@ -51,6 +51,7 @@ public class SummaryLoader {
|
||||
|
||||
private DashboardAdapter mAdapter;
|
||||
private boolean mListening;
|
||||
private boolean mWorkerListening;
|
||||
private ArrayList<BroadcastReceiver> mReceivers = new ArrayList<>();
|
||||
|
||||
public SummaryLoader(Activity activity, List<DashboardCategory> categories) {
|
||||
@@ -105,6 +106,7 @@ public class SummaryLoader {
|
||||
mActivity.unregisterReceiver(mReceivers.get(i));
|
||||
}
|
||||
mReceivers.clear();
|
||||
mWorker.removeMessages(Worker.MSG_SET_LISTENING);
|
||||
mWorker.obtainMessage(Worker.MSG_SET_LISTENING, listening ? 1 : 0, 0).sendToTarget();
|
||||
}
|
||||
|
||||
@@ -164,6 +166,8 @@ public class SummaryLoader {
|
||||
}
|
||||
|
||||
private synchronized void setListeningW(boolean listening) {
|
||||
if (mWorkerListening == listening) return;
|
||||
mWorkerListening = listening;
|
||||
if (DEBUG) Log.d(TAG, "Listening " + listening);
|
||||
for (SummaryProvider p : mSummaryMap.keySet()) {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user