import android.app.Activity;
import android.os.Bundle;
import com.baidu.mapapi.BMapManager;
import com.baidu.mapapi.map.MapView;
public class MainActivity extends Activity {
private BMapManager manager;
private MapView mapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
manager = new BMapManager(this); /*出错Multiple markers at this line- Syntax error on token “BMapManager”,
( expected after this token- The constructor BMapManager(MainActivity) is undefined*/]
manager.init(“6A9bg3BDnp7XNBhNEm7wzKD8”,null); //第一个参数为API Key,
//出错了The method init() in the type BMapManager is not applicable for the arguments (String, null)
setContentView(R.layout.activity_main);
mapView = (MapView)findViewById(R.id.map_view);
mapView.setBuiltInZoomControls(true);
//出错,The method setBuiltInZoomControls(boolean) is undefined for the type MapView
}
@Override
protected void onResume() {
mapView.onResume();
if(manager!=null){
manager.start(); //出错
}
super.onResume();
}
@Override
protected void onPause() {
mapView.onPause();
if(manager!=null){
manager.stop(); //出错
}
super.onPause();
}
@Override
protected void onDestroy() {
mapView.onDestroy();
if(manager!=null){
manager.destroy();
manager = null;
}
super.onDestroy();
}
}
出了5个错误,问一下怎么解决啊?
20
5
5