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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -