【发布时间】:2012-04-05 13:31:53
【问题描述】:
我有以下代码:
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 已经是布局的子项。
那么,我该如何解决呢?
【问题讨论】: