import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Date; import android.app.Activity; import android.content.Context; import android.graphics.Typeface; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.TextView; public class GPSInfoActivity extends Activity { private static final String TAG = "GPSInfoActivity"; private TextView tv_gps_info_lon; private TextView tv_gps_info_lat; private TextView tv_gps_info_hei; private TextView tv_gps_info_time; public static Typeface tf; private DecimalFormat df = new DecimalFormat("###.000000"); private LocationManager locationManager; private LocationListener LocationListener; private Location lastTimeLocation=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gpsinfo); ((OsmandApplication) getApplication()).setTopActivity(this); tv_gps_info_lon = (TextView) findViewById(R.id.tv_gps_info_lon); tv_gps_info_lat = (TextView) findViewById(R.id.tv_gps_info_lat); tv_gps_info_hei = (TextView) findViewById(R.id.tv_gps_info_hei); tv_gps_info_time = (TextView) findViewById(R.id.tv_gps_info_time); tf = Typeface.createFromAsset(getAssets(), "fonts/digi.ttf"); tv_gps_info_lon.setTypeface(tf); tv_gps_info_lat.setTypeface(tf); tv_gps_info_time.setTypeface(tf); tv_gps_info_hei.setTypeface(tf); locationManager= (LocationManager) getSystemService(Context.LOCATION_SERVICE); LocationListener = new LocationListener() { public void onLocationChanged(Location location) { //当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发 // log it when the location changes if (location != null) { locationManager.removeUpdates(LocationListener); } upd...