比如这样
double latitude,longitude;
latitude = 123.345;
longitude = 234.2342;
Location location = new Location();

解决方案 »

  1.   

    试试location.setLatitude(double latitude);
    location.setLongitude(double longitude);
      

  2.   

    GeoPoint point = new GeoPoint(latitude,longitude);
    location.setGeoPoint(point);
      

  3.   

    ocation.setLatitude(double latitude);
    location.setLongitude(double longitude);
    这句我试了 蹦出个空指针异常错误 我输出了latitude和longitude 正常输出 却在location.setLatitude(latitude)这句 说我空指针……
      

  4.   

    二楼的哥们 我没找到location.setGeoPoint这个函数 没有啊
      

  5.   


    空指针是说location没有实例
      

  6.   


    location.setLatitude(latitude);
    location.setLongitude(longitude);是这样吗?
      

  7.   

    嗯嗯 6楼的哥们 我就这么写的 空指针异常 最开始我定义了
    Location location;