在点击地图标记后,我正尝试在地图应用程序中显示一个自定义对话框。这是我的onTap(int index)的代码,根据Android开发人员指南,它不起作用。这是怎么回事?请帮帮我!
@Override
protected boolean onTap(int index) {
// TODO Auto-generated method stub
OverlayItem item = mOverlays.get(index);
Context mContext = getApplicationContext();
Dialog dialog = new Dialog(mContext);
dialog.setContentView(R.layout.marker_view);
dialog.setTitle(item.getTitle());
TextView textAddress = (TextView) dialog.findViewById(R.id.tv_marker_address);
TextView textPhone = (TextView) dialog.findViewById(R.id.tv_marker_phone);
textAddress.setText(item.getSnippet());
ImageView image = (ImageView) dialog.findViewById(R.id.marker_image);
dialog.show();
Button btn = (Button)dialog.findViewById(R.id.btn1);
btn1.setOnClickListener(this);
return true;
}
}发布于 2012-09-18 22:23:34
也许你需要先放大布局?
https://stackoverflow.com/questions/12455290
复制相似问题