Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Commit

Permalink
Fix Activity Error Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
bvolkmer committed Oct 16, 2017
1 parent fd0b548 commit 814dc42
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions android/src/main/java/de/x4fyr/paiman/app/utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
}

/**
Expand Down

0 comments on commit 814dc42

Please sign in to comment.