2011-05-20 75 views
0

我想在地图视图上显示一个简单的文本视图pushpin.on点击那个图钉我想显示详细信息。android mapview问题

当用户点击特定点我想显示该点的名称..这些名称我存储在POJO类中,我想从中检索,现在在我的代码中我成功地获取名称,但只有问题名称不会显示在该微粒分接点上。

请帮助...

这里是我的代码....

@Override 
     public boolean onTap(GeoPoint p, MapView mapView) {   
      str. 

      final PopupWindow popupWindow; 
      LayoutInflater inflater = getLayoutInflater(); 
      View layout = inflater.inflate(R.layout.popup, (ViewGroup) findViewById(R.id.rootId)); 

      TextView text = (TextView)layout.findViewById(R.id.nameTextView); 
      text.setText("Lake Name"); 
      text.setBackgroundColor(Color.BLACK); 

      popupWindow=new PopupWindow(layout); 
      popupWindow.setTouchable(true); 
      popupWindow.setWidth(LayoutParams.WRAP_CONTENT); 
      popupWindow.setHeight(LayoutParams.WRAP_CONTENT); 
      popupWindow.showAtLocation(layout,Gravity.CENTER_HORIZONTAL,10,0); 

      builder=new AlertDialog.Builder(DummyLocationActivity.this); 
      text.setOnClickListener(new OnClickListener() { 

       @Override 
       public void onClick(View v) { 

        popupWindow.dismiss(); 
        LayoutInflater inflater=LayoutInflater.from(DummyLocationActivity.this); 

       View desc= inflater.inflate(R.layout.description,(ViewGroup) findViewById(R.id.root)); 
       builder.setView(desc); 

       builder.show(); 
       } 


      }); 
      return true; 
} 

回答

0

OnTap中(INT位置),您可以通过使用位置获得自来水的特定项目。