Replace deprecated method

This commit is contained in:
Martin Fietz 2018-01-10 22:02:59 +01:00
parent 21ac9d158f
commit 0238d24216
1 changed files with 2 additions and 7 deletions

View File

@ -270,16 +270,11 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
feed.getDownload_url(), "OnlineFeed", 0, Feed.FEEDFILETYPE_FEED, username, password,
true, null);
download = Observable.create(new Observable.OnSubscribe<DownloadStatus>() {
@Override
public void call(Subscriber<? super DownloadStatus> subscriber) {
download = Observable.fromCallable(() -> {
feeds = DBReader.getFeedList();
downloader = new HttpDownloader(request);
downloader.call();
Log.d(TAG, "Download was completed");
subscriber.onNext(downloader.getResult());
subscriber.onCompleted();
}
return downloader.getResult();
})
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())