Skip to content

Enable my location on Android #7

@mikebikerider

Description

@mikebikerider

I encountered a problem with enabling 'My Location' on Android devices. It works as expected during the first run on Android device after permission 'When using app' requested and granted by Android OS. The next time app is launched when there is no permission prompt, device location is acquired but no blue circle shown. The click on the MyLocationButton in map top right corner produces only click sound. The location active icon in system area is visible.

Your Sample app behavior is same with one exception: no 'location active' icon in the system area on top while 'MyLocationButton' is shown.

The awkward workaround is to start moving the app into the background using your finger and get it back before completing. It does not matter whether 'Enable My Location' is turned on at that point. After the app is back in focus 'my location' works as expected. Once 'My Location' is enabled, the blue circle appears and clicking MyLocationButton in the top right map corner centers the map on device location. The odd fix might explain why it works after Android permissions prompt. While the prompt has focus, the app is temporarily in the background.

I was testing in Debug, Release and Production mode. No difference. I used Samsung Galaxy S20 running Android 34. I have on the same Galaxy S20 my apps using Mr. Onion library. They don't have that issue.

There is no issue under iOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions