点击地图标记后,我试图在我的地图应用程序中显示自定义对话框。这是我根据 Android 开发人员指南的 onTap(int index) 代码,它不起作用。这里有什么问题?请帮忙 !
@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;
}
}