当我单击 dispatchTap() 方法时,我想显示新布局。如何在单击当前位置时为新布局充气 .. 这是我的代码
public class CurrentLocationOverlay extends MyLocationOverlay {
private Context mContext;
private MapView mMapView;
private Location mCurrentLocation;
private MapController myMapController;
double latitude, longitude;
public CurrentLocationOverlay(Context context, MapView mapView) {
super(context, mapView);
mContext = context;
mMapView = mapView;
}
@Override
protected boolean dispatchTap() {
// TODO handle a tap on "my location point", eg. display an option to
// send SMS, make a call, add a picture to current location point.
Toast.makeText(mContext, "Suppressing data readout", Toast.LENGTH_SHORT).show();
return true;
}
/*LayoutInflater layoutInflater = (LayoutInflater)
mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LayoutParams lp = new MapView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, p, LayoutParams.WRAP_CONTENT);
LinearLayout view = (LinearLayout)inflater.inflate(R.layout.map_overlay, null);
*/
}![enter image description here][1]