From cca4c9b0bcc1bd7742d419166fd5cfd5415fde9e Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Sat, 5 Apr 2014 14:55:40 +0200 Subject: Do not use AndroidObservable This lets us return to an unmodified version of RxJava. --- main/src/cgeo/geocaching/DataStore.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'main/src/cgeo/geocaching/DataStore.java') diff --git a/main/src/cgeo/geocaching/DataStore.java b/main/src/cgeo/geocaching/DataStore.java index f627d7d..ee6c9ef 100644 --- a/main/src/cgeo/geocaching/DataStore.java +++ b/main/src/cgeo/geocaching/DataStore.java @@ -20,16 +20,15 @@ import cgeo.geocaching.settings.Settings; import cgeo.geocaching.ui.dialog.Dialogs; import cgeo.geocaching.utils.FileUtils; import cgeo.geocaching.utils.Log; +import cgeo.geocaching.utils.RxUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.eclipse.jdt.annotation.NonNull; -import rx.android.observables.AndroidObservable; import rx.functions.Action1; import rx.functions.Func0; import rx.functions.Func1; -import rx.schedulers.Schedulers; import rx.util.async.Async; import android.app.Activity; @@ -393,7 +392,7 @@ public class DataStore { */ public static void moveDatabase(final Activity fromActivity) { final ProgressDialog dialog = ProgressDialog.show(fromActivity, fromActivity.getString(R.string.init_dbmove_dbmove), fromActivity.getString(R.string.init_dbmove_running), true, false); - AndroidObservable.bindActivity(fromActivity, Async.fromFunc0(new Func0() { + RxUtils.subscribeOnIOThenUI(Async.fromCallable(new Func0() { @Override public Boolean call() { if (!LocalStorage.isExternalStorageAvailable()) { @@ -418,7 +417,7 @@ public class DataStore { init(); return true; } - })).subscribeOn(Schedulers.io()).subscribe(new Action1() { + }), new Action1() { @Override public void call(final Boolean success) { dialog.dismiss(); -- cgit v1.1