diff --git a/android/src/main/java/de/x4fyr/paiman/app/utils.kt b/android/src/main/java/de/x4fyr/paiman/app/utils.kt index 9f4d015..4da5635 100644 --- a/android/src/main/java/de/x4fyr/paiman/app/utils.kt +++ b/android/src/main/java/de/x4fyr/paiman/app/utils.kt @@ -12,6 +12,8 @@ import android.view.MenuItem import android.view.View import de.x4fyr.paiman.R import de.x4fyr.paiman.lib.adapter.AndroidGoogleDriveStorageAdapter +import kotlinx.coroutines.experimental.android.UI +import kotlinx.coroutines.experimental.launch import java.io.File import java.io.InputStream import javax.inject.Inject @@ -101,10 +103,12 @@ suspend fun Activity.getInputStreamFromUrl(url: String): InputStream? { /** Error [AlertDialog] */ fun Activity.errorDialog(msg: Int) { - AlertDialog.Builder(this) - .setMessage(msg) - .create() - .show() + launch(UI) { + AlertDialog.Builder(this@errorDialog) + .setMessage(msg) + .create() + .show() + } } /**