You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know if location is enabled or not in an Android device.
My case is that if the user gives permissions to use the location, with the method GetLastKnownLocationAsync() I can get null if it is not possible to get the last location.
One reason could be that there is no GPS signal when the location is enabled.
And another reason could be because the location is disabled in the settings of the device.
I would like to know both cases, because in my case I would like to implment different logic in each case.
Is it possible to know if the location is disabled?
Thanks.
Public API Changes
Perhaps it could be possible a method like Location.IsEnabled() that returns a bool.
Intended Use-Case
bool isLocationEnabled = Location.IsEnabled();
if(isLocationEnabled == false)
{
//Ask user to enabled it
//if user tells no: do Action1();
//else do nothing, wait user enables location and try again.
}
else
{
//do Action2();
}
The text was updated successfully, but these errors were encountered:
Description
I would like to know if location is enabled or not in an Android device.
My case is that if the user gives permissions to use the location, with the method GetLastKnownLocationAsync() I can get null if it is not possible to get the last location.
One reason could be that there is no GPS signal when the location is enabled.
And another reason could be because the location is disabled in the settings of the device.
I would like to know both cases, because in my case I would like to implment different logic in each case.
Is it possible to know if the location is disabled?
Thanks.
Public API Changes
Perhaps it could be possible a method like Location.IsEnabled() that returns a bool.
Intended Use-Case
The text was updated successfully, but these errors were encountered: