这是百度官方的开发者指南里的初始化LocationClient类的代码:
public LocationClient mLocationClient = null;
public BDLocationListener myListener = new MyLocationListener();
 
public void onCreate() {
    mLocationClient = new LocationClient(getApplicationContext());     //声明LocationClient类
    mLocationClient.registerLocationListener( myListener );    //注册监听函数
}
其中,MyLocationListener()在eclipse中提示错误:
MyLocationListener cannot be resolved to a type MainActivity.java 我用的是V3.3的定位SDK,仔细检查过确保所有要求的都import了。百度SDK

解决方案 »

  1.   

    MyLocationListener应该是第三方jar包吧
    新建libs目录把 jar包丢进去 ---add to build path
      

  2.   

    MyLocationListener是自己写的一个实现BDLocationListener 的类,你看看有没有。
      

  3.   

    我把jar包扔到libs后刷新就全部出来了,没找到add to build path..
      

  4.   

    自己写要怎么写,刚刚开始接触android,很多都不懂,烦请指点