Fix a NetworkOnMainThreadException

This commit is contained in:
Bradlee Speice 2014-06-14 14:10:43 -04:00
parent ba3c6ebe6c
commit 93abe065a2

View File

@ -9,6 +9,8 @@ import org.crosswire.jsword.book.install.Installer;
import javax.inject.Inject; import javax.inject.Inject;
import rx.schedulers.Schedulers;
/** /**
* Thread that handles downloading a book * Thread that handles downloading a book
*/ */
@ -31,6 +33,7 @@ public class BookDownloadThread {
// First, look up where the Book came from // First, look up where the Book came from
refreshManager.installerFromBook(b) refreshManager.installerFromBook(b)
.subscribeOn(Schedulers.io())
.subscribe((installer) -> { .subscribe((installer) -> {
try { try {
installer.install(b); installer.install(b);