私は次のコードを持っています:
setContentView(R.layout.maplayout);
// Create Rotate view
mRotateView = new RotateView(this);
// create a map view
mapView = (MapView) findViewById(R.id.mapview);
mRotateView.addView(mapView); // error here
setContentView(mRotateView);
mylocation = new MyLocationOverlay(this,mapView);
しかし、ビューを追加すると、指定された子にすでに親があるというエラーが表示されます。これは、mapViewがすでにレイアウトの子であるためだと思います。
では、どうすればこれを解決できますか?