0

GPSからの更新で毎秒マップに円を追加しようとしています。Location = locationmanager.getLastKnownLocation(provider); を渡すにはどうすればよいですか。毎秒新しい円を作るには?これが私がこれまでに持っているものです。

public class MainActivity extends Activity implements LocationListener{

Location myLocation;

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


GoogleMap mMap;
mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();


mMap.setMyLocationEnabled(true);





Location myLocation;

LocationManager locationmanager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria cr = new Criteria();
String provider = locationmanager.getBestProvider(cr, true);
Location location = locationmanager.getLastKnownLocation(provider);

locationmanager.requestLocationUpdates(provider, 1000, 0, (LocationListener) this);

CircleOptions circleOptions = new CircleOptions()
.center(new LatLng( , ))
.radius(3.048); // In meters

Circle circle = mMap.addCircle(circleOptions);



 }

}

4

1 に答える 1