无法导入com.google.android.maps.MapView(Eclipse)

时间:2010-11-13 07:21:32

标签: java android

import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.view.ViewGroup;
import android.widget.*;
import com.google.android.maps.MapView;

public class MapView extends MapActivity {
      LinearLayout linearLayout;
      MapView mapView;

      /** Called when the activity is first created. */
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.map);
          mapView = (MapView) findViewById(R.id.mapview);
          mapView.setBuiltInZoomControls(true);
          MapController mapController = mapView.getController();
      }
}

2 个答案:

答案 0 :(得分:1)

乍一看,Google MapView和MapView类之间存在名称冲突。只需将您的类重命名为MyMapView

即可

答案 1 :(得分:0)

我刚刚意识到我必须安装谷歌api来解决我的问题