I'm trying to implement Change location settings to enable gps setting
from here: https://developer.android.com/training/location/change-location-settings
it says check the result in onActivityResult() but i don't how to observe the result in jetpack compose. Please Tell me how to observe this result in compose
task.addOnFailureListener { exception ->
if (exception is ResolvableApiException){
// Location settings are not satisfied, but this can be fixed
// by showing the user a dialog.
try {
// Show the dialog by calling startResolutionForResult(),
// and check the result in onActivityResult().
exception.startResolutionForResult(this@MainActivity,
REQUEST_CHECK_SETTINGS)
} catch (sendEx: IntentSender.SendIntentException) {
// Ignore the error.
}
}
}