I got to remove the data from the GPS receiver.
First, added new class to java cod:
==============================
package org.hecl.location;
import android.app.Application;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
public class LocationGet extends Application {
public int requestLocationUpdates(LocationManager locationManager) {
//LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location) {}
public void onStatusChanged(String provider, int status, Bundle extras) {}
public void onProviderEnabled(String provider) {}
public void onProviderDisabled(String provider) {}
};
// Register the listener with the Location Manager to receive location updates
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
return 7;
}
}
==============================================
Then, do the following:
proc Timer { ls } {
set loct [$ls getlastknownlocation gps]
after 1000 [list Timer $ls]
}
java android.location.LocationManager lm
java android.location.LocationProvider lp
java android.location.LocationListener ll
java org.hecl.location.LocationGet lg
set ls [$context getsystemservice LOCATION_SERVICE]
set a [lg -new {}]
set b [$a requestlocationupdates $ls]
Timer $ls
======================================================
But if I'm in the Timer sets the value for the widget edittext, its value is not updated.
The reason?
I think in the command "after".
How to get around this inconvenience?