Skip to content

Instantly share code, notes, and snippets.

@mazzouzi
Created June 14, 2022 09:22
Show Gist options
  • Save mazzouzi/77c1036aec79ff3c73a4e3906e8a6361 to your computer and use it in GitHub Desktop.
Save mazzouzi/77c1036aec79ff3c73a4e3906e8a6361 to your computer and use it in GitHub Desktop.
object DialogUtilSolution {
fun showError(context: Context?, title: String?, message: String?) {
if (context == null || (context as? Activity?)?.isFinishing == true) {
return
}
MaterialAlertDialogBuilder(context)
.setCancelable(true)
.setTitle(title)
.setMessage(message)
.setPositiveButton("OK", null)
.create()
.show()
}
// fun showSuccess(context, )...
// fun showLoader(context, )...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment