Permalink
Browse files

QuestionFragment, SubjectExtrasFragment: Avoid repeat onLoadFinished(…

…) calls.

This seems to be an Android bug. It causes us to do the same work repeatedly.
  • Loading branch information...
murraycu committed Oct 9, 2014
1 parent 841bac4 commit 3438f8a2f639699e6f026f4daa8531190d547f55
@@ -694,6 +694,11 @@ public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {

mLoaderFinished = true;
updateIfReady();

// Avoid this being called twice (actually multiple times), which seems to be an Android bug:
// See http://stackoverflow.com/questions/14719814/onloadfinished-called-twice
// and https://code.google.com/p/android/issues/detail?id=63179
getLoaderManager().destroyLoader(URL_LOADER);
}

private void updateIfReady() {
@@ -263,6 +263,11 @@ public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {

mLoaderFinished = true;
updateIfReady();

// Avoid this being called twice (actually multiple times), which seems to be an Android bug:
// See http://stackoverflow.com/questions/14719814/onloadfinished-called-twice
// and https://code.google.com/p/android/issues/detail?id=63179
getLoaderManager().destroyLoader(URL_LOADER);
}

private void updateIfReady() {

0 comments on commit 3438f8a

Please sign in to comment.