Question

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!!

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top