0

私はアンドロイドで逆ジオコーディングを実装しようとしていますが、いくつかの問題があります。ここに私のコードがあります:

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        textLong = (TextView) findViewById(R.id.textLong);
        textLat = (TextView) findViewById(R.id.textLat);


        LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        LocationListener listener = new myLocationListner();
        manager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, listener);




    }

    public class myLocationListner implements LocationListener{

        @Override
        public void onLocationChanged(Location location) {
            if (location != null){

                double gettextLong = location.getLongitude();
                double gettextLat = location.getLatitude();

                textLat.setText(Double.toString(gettextLat));
                textLong.setText(Double.toString(gettextLong));


            }
4

1 に答える 1