I was using LocationManager to track the user current location, Now after changing location manager to FusedLocation API, the blue dot and circle is not shown even after setting map.setMyLocationEnabled(true)
. I can see the current location icon on top right corner in my map fragment but clicking on it does nothing. I reverted my code to LocationManager now i am able to see the blue dot pointing to my current location. what could be wrong using Fused Location API.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
For targeting api-23 or higher
See this answer....
For targeting api-22 and lower:
This code works for me, it has the
MyLocation
blue dot/circle, and it also places aMarker
on the current location using the Fused Location Provider.Here is the entire Activity code I used:
activity_main.xml:
Result:
You have to add the following permissions in manifest:
Try this,