@Override
        public void onClick(View v) {
          // TODO Auto-generated method stub
          if (v == addButton) {
            Intent intent = new Intent(selectBuildingActivity.this, createFloorDialog.class);
            startActivityForResult(intent, REQUEST_CREATE_FLOOR);
          } else {
            Tag t = (Tag) v.getTag(R.id.floorlistkey);
            switch (t.type) {
              case KEY_DELETE:
                try {
                  svc.removeFloorById(FloorList.get(t.count).getId().intValue());

                  svc.updateIntoDB();
                } catch (SQLException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
                }
                FloorList.remove(t.count);
                adapter.notifyDataSetChanged();
                break;
              case KEY_SELECT:
                Intent intent = new Intent(selectBuildingActivity.this, workMappingActivity.class);
                //
                Floor f = FloorList.get(t.count);
                intent.putExtra("img", f.getImage());
                Log.e("fd", "aa" + f.getImage());
                intent.putExtra("z", f.getZ());
                intent.putExtra("scale", f.getImageScale());
                //
                startActivity(intent);
                break;
              case KEY_COLLECT:
                Intent c_intent = new Intent(selectBuildingActivity.this, collectActivity.class);
                //
                Floor cf = FloorList.get(t.count);
                c_intent.putExtra("img", cf.getImage());
                c_intent.putExtra("z", cf.getZ());
                c_intent.putExtra("scale", cf.getImageScale());
                //
                startActivity(c_intent);
                break;
            }
          }
        }
 public void FloorInit() {
   id = 0;
   FloorList = new ArrayList<Floor>();
   Floor[] floor_arr = null;
   try {
     Log.e("DB service", "Service : " + svc.toString());
     Log.e("DB service", "callgetallfloor");
     floor_arr = svc.getAllFloors();
     Log.e("DB service", "Service : " + floor_arr);
     if (floor_arr == null) return;
   } catch (SQLException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   if (floor_arr != null) {
     for (Floor f : floor_arr) {
       FloorList.add(f);
       Log.e("fd", f.toString());
       id = f.getId().intValue();
     }
   }
 }
  public void init() {
    drawInit();
    svc = new MappingService(PreferenceUtil.getAppPreferences(this, "IP"));

    setZorder();
    //
    ArrayList<BaseMeasurepoint> bmpList = new ArrayList<BaseMeasurepoint>();
    ArrayList<Measurepoint> mpList = new ArrayList<Measurepoint>();
    ArrayList<MeasurepointLink> mpLinkList = new ArrayList<MeasurepointLink>();
    ArrayList<Waypoint> wpList = new ArrayList<Waypoint>();
    ArrayList<WaypointLink> wpLinkList = new ArrayList<WaypointLink>();
    ArrayList<PointOfInterest> poiList = new ArrayList<PointOfInterest>();
    try {
      BaseMeasurepoint[] bmp = svc.getAllBaseMeasurepoints();
      Measurepoint[] mp = svc.getAllMeasurepoints();
      MeasurepointLink[] mpl = svc.getAllMeasurepointLinks();
      Waypoint[] wp = svc.getAllWaypoints();
      WaypointLink[] wpl = svc.getAllWaypointLinks();
      PointOfInterest[] poi = svc.getAllPointOfInterests();
      if (poi != null) {
        for (PointOfInterest temp : poi) {
          poiList.add(temp);
        }
        ((POIOverlayView) overlay[2]).setPointOfInterestList(poiList);
      }
      if (wpl != null) {
        for (WaypointLink temp : wpl) {
          wpLinkList.add(temp);
        }
        ((WayPointOverlayView) overlay[3]).setWaypointLinkList(wpLinkList);
      }
      if (wp != null) {
        for (Waypoint temp : wp) {
          wpList.add(temp);
        }
        ((WayPointOverlayView) overlay[3]).setWaypointList(wpList);
      }
      if (mpl != null) {
        for (MeasurepointLink temp : mpl) {
          mpLinkList.add(temp);
        }
        ((MeasurePointOverlayView) overlay[1]).setMeasurepointLinkList(mpLinkList);
      }
      if (mp != null) {
        for (Measurepoint temp : mp) {
          mpList.add(temp);
        }
        ((MeasurePointOverlayView) overlay[1]).setMeasurepointList(mpList);
      }
      if (bmp != null) {
        for (BaseMeasurepoint temp : bmp) {
          bmpList.add(temp);
        }
        ((MeasurePointOverlayView) overlay[1]).setBaseMeasurepointList(bmpList);
      }
      updateList();
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    //

    menu_botton_init();
  }