I have this code that I use to host the map application. I tested it on a Galaxy S2 device and worked great, but when I tested it on a nexus 4 device, callback onLocationChanged never called. What can i do wrong?
Here is my activity code:
public class BaseMapActivity extends FragmentActivity implements Injectable, GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener, LocationListener { private final static int CONNECTION_FAILURE_RESOLUTION_REQUEST = 9000; private MapEntity component; private boolean yetStarted = false; private LocationClient mLocationClient; private LocationRequest mLocationRequest; private Location location; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map_activity); mLocationClient = new LocationClient(this, this, this); mLocationRequest = LocationRequest.create(); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
It is strange that it works on one device, but not in another.
source share