Skip to content

Instantly share code, notes, and snippets.

@reinskywalker
Created September 8, 2021 10:03
Show Gist options
  • Save reinskywalker/e4db7e7cca2898d42967813ed10b4fd9 to your computer and use it in GitHub Desktop.
Save reinskywalker/e4db7e7cca2898d42967813ed10b4fd9 to your computer and use it in GitHub Desktop.
camera abstract
override fun onProviderDisabled(provider: String) {
AlertDialog.Builder(this).apply {
setTitle("GPS Signal Not Found")
setMessage("Pastikan fitur GPS pada perangkat anda aktif ketika menggunakan aplikasi ini")
setCancelable(true)
setPositiveButton("Back") { dialogInterface: DialogInterface, _: Int ->
dialogInterface.dismiss()
finish()
}
}.show()
Toast.makeText(this, "GPS Signal Lost", Toast.LENGTH_SHORT).show()
}
override fun onProviderEnabled(provider: String) {
Toast.makeText(this, "GPS Signal Is Online", Toast.LENGTH_SHORT).show()
}
override fun onStatusChanged(provider: String?, status: Int, extras: Bundle?) {
Timber.d("status = $status")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment