Browse Source

Fixing exception thrown due to observable using the wrong thread

master
anthony restaino 8 years ago
parent
commit
a79a5e8a9b
  1. 2
      app/src/main/java/acr/browser/lightning/fragment/BookmarkSettingsFragment.java

2
app/src/main/java/acr/browser/lightning/fragment/BookmarkSettingsFragment.java

@ -480,6 +480,7 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
SubscriptionUtils.safeUnsubscribe(mImportSubscription); SubscriptionUtils.safeUnsubscribe(mImportSubscription);
mImportSubscription = BookmarkExporter.importBookmarksFromFile(mFileList[which]) mImportSubscription = BookmarkExporter.importBookmarksFromFile(mFileList[which])
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(Schedulers.main())
.subscribe(new SingleOnSubscribe<List<HistoryItem>>() { .subscribe(new SingleOnSubscribe<List<HistoryItem>>() {
@Override @Override
public void onItem(@Nullable final List<HistoryItem> importList) { public void onItem(@Nullable final List<HistoryItem> importList) {
@ -487,6 +488,7 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
Preconditions.checkNonNull(importList); Preconditions.checkNonNull(importList);
mBookmarkManager.addBookmarkList(importList) mBookmarkManager.addBookmarkList(importList)
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.main()) .observeOn(Schedulers.main())
.subscribe(new CompletableOnSubscribe() { .subscribe(new CompletableOnSubscribe() {
@Override @Override

Loading…
Cancel
Save