/** POI信息查询回调方法 */
  @Override
  public void onPoiSearched(PoiResult result, int rCode) {
    dissmissProgressDialog(); // 隐藏对话框
    if (rCode == 0) {
      if (result != null && result.getQuery() != null) { // 搜索poi的结果
        if (result.getQuery().equals(query)) { // 是否是同一条
          poiResult = result;
          // 取得搜索到的poiitems有多少页
          List<PoiItem> poiItems = poiResult.getPois(); // 取得第一页的poiitem数据,页数从数字0开始
          List<SuggestionCity> suggestionCities =
              poiResult.getSearchSuggestionCitys(); // 当搜索不到poiitem数据时,会返回含有搜索关键字的城市信息

          if (poiItems != null && poiItems.size() > 0) {
            aMap.clear(); // 清理之前的图标
            PoiOverlay poiOverlay = new PoiOverlay(aMap, poiItems);
            poiOverlay.removeFromMap();
            poiOverlay.addToMap();
            poiOverlay.zoomToSpan();
          } else if (suggestionCities != null && suggestionCities.size() > 0) {
            showSuggestCity(suggestionCities);
          } else {
            ToastUtil.show(PoiKeywordSearchActivity.this, "no_result");
          }
        }
      } else {
        ToastUtil.show(PoiKeywordSearchActivity.this, "no_result");
      }
    } else if (rCode == 27) {
      ToastUtil.show(PoiKeywordSearchActivity.this, "error_network");
    } else if (rCode == 32) {
      ToastUtil.show(PoiKeywordSearchActivity.this, "验证无效");
    } else {
      ToastUtil.show(PoiKeywordSearchActivity.this, "未知错误" + rCode);
    }
  }
 /** 点击搜索按钮 */
 public void searchButton() {
   keyWord = AMapUtil.checkEditText(searchText);
   if ("".equals(keyWord)) {
     ToastUtil.show(PoiKeywordSearchActivity.this, "请输入搜索关键字");
     return;
   } else {
     doSearchQuery();
   }
 }
 /** 点击下一页按钮 */
 public void nextButton() {
   if (query != null && poiSearch != null && poiResult != null) {
     if (poiResult.getPageCount() - 1 > currentPage) {
       currentPage++;
       query.setPageNum(currentPage); // 设置查后一页
       poiSearch.searchPOIAsyn();
     } else {
       ToastUtil.show(PoiKeywordSearchActivity.this, "no result");
     }
   }
 }
 /** poi没有搜索到数据,返回一些推荐城市的信息 */
 private void showSuggestCity(List<SuggestionCity> cities) {
   String infomation = "推荐城市\n";
   for (int i = 0; i < cities.size(); i++) {
     infomation +=
         "城市名称:"
             + cities.get(i).getCityName()
             + "城市区号:"
             + cities.get(i).getCityCode()
             + "城市编码:"
             + cities.get(i).getAdCode()
             + "\n";
   }
   ToastUtil.show(PoiKeywordSearchActivity.this, infomation);
 }