Possible Duplicate:
How do I get the current GPS location programmatically in Android?
兹颁布以下法典。 这能否带我自己的位置?
public class MyLocationListener implements LocationListener {
public static double latitude;
public static double longitude;
public void onLocationChanged(Location loc)
{
loc.getLatitude();
loc.getLongitude();
latitude=loc.getLatitude();
longitude=loc.getLongitude();
}
public void onProviderDisabled(String provider)
{
//print "Currently GPS is Disabled";
}
public void onProviderEnabled(String provider)
{
//print "GPS got Enabled";
}
public void onStatusChanged(String provider, int status, Bundle extras)
{
}
}
我知道这一点几次被问到。 请帮助我制定法典......