I was hoping someone could put some light on it. I am trying to understand that my code will not always work with 2.2 to 2.3. I'm a bit confused. It's the code that's working, but now a null pointer is throwing exceptions. Public Zero Start (Intent Intent, int startId) {LocationListener locationListener = new LocationListener () {change location on public zeroes (location L) {Log.i ("MYSERVICE",
@Override "Scattered" + L); } Sender enabled (string provider) to public zero {} public zonation on Status Changez (String Provider, Int Status, Bundle Extras) {Log.i ("MYSERVICE", "Provider Enabled" + Provider); } Public void onProviderDisabled (string provider) {}}; Lm = (LocationManager) getSystemService (context.LOCATION_SERVICE); Lm.requestLocationUpdates (LocationManager.GPS_PROVIDER, 0, 0, locationListener); Super .Onstart (intent, initial); String location = mile (); } Public string getLocation () {string provider = location manager. GPS_PROVIDER; Location Location = lm.getLastKnownLocation (Provider); Double latitude = location. Gelititis (); Log.i ("lat", lat.toString ()); Double LNG = location.getLongitude (); String Written String = Latitude + "& amp;" + Lng; Return writing string; } & Lt; Usage-permission Android: name = "android.permission.ACCESS_FINE_LOCATION" /> I am using the 2.3 emulator.
the location of the meeting pillar location can return zero if any previous location If yes, then you will have to wait for the value in the onLocationChanged with the listener registered.
Comments
Post a Comment