mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
Fix crash(es) caused by failing to dispose Rx observables (#2669)
This commit is contained in:
parent
38d39e08ac
commit
8474c04c64
21 changed files with 121 additions and 86 deletions
|
|
@ -142,6 +142,12 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
initDrawer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
compositeDisposable.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* To invoke the AlertDialog on clicking info button
|
||||
*/
|
||||
|
|
@ -238,12 +244,12 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
if (StringUtils.isNullOrWhiteSpace(userName)) {
|
||||
return;
|
||||
}
|
||||
okHttpJsonApiClient.getWikidataEdits(userName)
|
||||
compositeDisposable.add(okHttpJsonApiClient.getWikidataEdits(userName)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(edits -> wikidataEditsText.setText(String.valueOf(edits)), e -> {
|
||||
Timber.e("Error:" + e);
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
private void showSnackBarWithRetry() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue