android - Not able to get Location updates using fused Api client -
im trying make app android wear shows real time location of user in map. im using locationservices.fusedlocationapi.requestlocationupdates location updates using location request:
protected void createlocationrequest() { mlocationrequest.setinterval(3000); mlocationrequest.setfastestinterval(1000); mlocationrequest.setpriority(locationrequest.priority_high_accuracy); } @override public void onresume() { mmapfragment.onresume(); super.onresume(); checkpermission(); locationservices.fusedlocationapi.requestlocationupdates( mapiclient, mlocationrequest, this); } @override public void onpause() { super.onpause(); locationservices.fusedlocationapi.removelocationupdates(mapiclient,this); }
in oncreateview call createlocationrequest method.
what expected every time location change, onlocationchanged method of listener call. instead of that, call onlocationchanged each time app in onresume (because have locationservices.fusedlocationapi.requestlocationupdates).
i have permissions in manifest
<uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" />
this class im asking location updates fragment have map, dont know if affects.
Comments
Post a Comment