打开我的应用程序时如何显示用户的当前位置 [英] How to show current location of user while open my app

查看:142
本文介绍了打开我的应用程序时如何显示用户的当前位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要制作一个应用程序,当用户打开我的应用程序时,该用户将获得他们在我应用程序中的当前位置,而当用户更改其位置时,它也会在特定时间后更新. 我获得了更改位置的解决方案,而用户更改了位置,但是我需要在用户打开我的应用时显示用户的当前位置.

I want to make an app, when user open my app user will get their current location in my app and while user change their location it will also update after some specific time. I got solution of changed location while user change their location but i need to show current location of user while user open my app.

推荐答案

googleMap.setMyLocationEnabled(true);
Location myLocation = googleMap.getMyLocation();

这些是获取当前位置的关键行.

These are the the key lines to get current location.

有关更多信息,请参考以下教程: Android使用以下方法在地图上显示当前位置谷歌地图api

for more info ,refer these tutorials: android show current location on map using google maps api

如何在google map android中获取当前位置

这篇关于打开我的应用程序时如何显示用户的当前位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆