문제

Im using this code http://wptrafficanalyzer.in/blog/android-searchview-widget-with-actionbarcompat-library/ to use the autosearch for map positions. I would like to open the map with my current actual position. Meaning before i open my map activity i need my current location. how do i doo this? Thanks!!

도움이 되었습니까?

해결책

If you are using Google Map API V2 then use this method. It will display my location button on map.

googleMap.setMyLocationEnabled(true);

or you can add marker on map using your current lat-long.

API Document

Example

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top