如何让百度地图显示出来?(问题出现位置已用!!!表示)
2017-01-08 17:24
447 查看
package com.baidumaptest;
import android.app.Activity;
import android.os.Bundle;
import com.baidu.lbsapi.BMapManager;
import com.baidu.mapapi.map.MapView;
public class ABMMainActivity extends Activity {
private BMapManager manager;
private MapView mapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
manager = new BMapManager(this);
manager.init("SHVPoTtIpzfonPD3HCkc5sIt", null);!!!
setContentView(R.layout.abmmain);
mapView = (MapView) findViewById(R.id.map_view);
mapView.setBuiltInZoomControls(true);!!!
}
@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.destroy();!!!
if (manager != null) {
manager.destroy();
manager = null;
}
super.onDestroy();
}
}
出现以下几个问题:
1、The method init(MKGeneralListener) in the type BMapManager is not applicable for the arguments (String, null)
2、The method setBuiltInZoomControls(boolean) is undefined for the type MapView
3、The method start() is undefined for the type BMapManager
4、The method stop() is undefined for the type BMapManager
5、The method destroy() is undefined for the type MapView
是引用包问题还是什么,个人觉得问题也许处在private BMapManager manager;这里。
请大神们帮我看看,小白在此多谢啦!
import android.app.Activity;
import android.os.Bundle;
import com.baidu.lbsapi.BMapManager;
import com.baidu.mapapi.map.MapView;
public class ABMMainActivity extends Activity {
private BMapManager manager;
private MapView mapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
manager = new BMapManager(this);
manager.init("SHVPoTtIpzfonPD3HCkc5sIt", null);!!!
setContentView(R.layout.abmmain);
mapView = (MapView) findViewById(R.id.map_view);
mapView.setBuiltInZoomControls(true);!!!
}
@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.destroy();!!!
if (manager != null) {
manager.destroy();
manager = null;
}
super.onDestroy();
}
}
出现以下几个问题:
1、The method init(MKGeneralListener) in the type BMapManager is not applicable for the arguments (String, null)
2、The method setBuiltInZoomControls(boolean) is undefined for the type MapView
3、The method start() is undefined for the type BMapManager
4、The method stop() is undefined for the type BMapManager
5、The method destroy() is undefined for the type MapView
是引用包问题还是什么,个人觉得问题也许处在private BMapManager manager;这里。
请大神们帮我看看,小白在此多谢啦!
相关文章推荐
- LDD3源码分析之ioctl操作 .
- [SDOI2008]仪仗队
- [Leetcode]480. Sliding Window Median
- webpack解惑:require的五种用法
- [leetcode]442. Find All Duplicates in an Array
- 怎样实现二级联动菜单即可选择又可输入???
- 小博老师解析Java核心技术 ——动态解析Jar的运用
- 请教:android studio中gradle plugin版本和gradle版本怎么对应?
- C++面向对象模型初探
- 数组和指针
- Python-内置函数
- python 3.6 lxml包安装过程记录
- Servlet的线程是不是共享同一个requset对象及servlet多线程
- java学习——java面试【事务、锁、多线程】资料整理
- webuploader文件接收服务端(文件上传)
- Appcompat主题,按实体菜单键怎么隐藏底部的menu视图
- linux时间子系统 - hrtimer
- 如何repo下载google源码到移动硬盘?菜鸟求教。
- pandas库简介(1)--pandas的三种数据结构
- Oracle创建一表空间,用户,并授权。导入dmp