Google maps V2 android get current location -


im trying place marker on position am, way:

googlemap = ((mapfragment) getfragmentmanager().findfragmentbyid(r.id.map_container)).getmap(); googlemap.setmylocationenabled(true); 

my question is, how coordinates mylocation, tried, googlemap.getmylocation().getlatitude() , googlemap.getmylocation().getaltitude() right after googlemap.setmylocationenabled(true), app crashes, thing did location loc=lm.getlastknownlocation(provider) not same coordinates , marker placed in wrong place.

how can people me?

 supportmapfragment mf =(supportmapfragment)getsupportfragmentmanager().findfragmentbyid(r.id.map);     mmap = mf.getmap();     mmap.setmylocationenabled(true);     mmap.setmaptype(mmap.map_type_normal); 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -