有没有办法在谷歌地图 v2 弹出窗口中点击另一个活动的意图?
这是我的代码:
@Override
public View getInfoContents(Marker marker)
{
View popup=inflater.inflate(R.layout.popup, null);
final TextView tvtitulo=(TextView)popup.findViewById(R.id.tvTitulo);
TextView tvDatos=(TextView)popup.findViewById(R.id.tvDatos);
TextView tvCat=(TextView)popup.findViewById(R.id.tvCategoria);
tvtitulo.setText(marker.getTitle());
StringTokenizer tokens = new StringTokenizer(marker.getSnippet(), "?");
final String first = tokens.nextToken();// this will contain "Fruit"
String second = tokens.nextToken();// this will contain " they taste good"
tvDatos.setText(first);
tvCat.setText(second);
ImageView imagen = (ImageView)popup.findViewById(R.id.menuImgView);
if(marker.getTitle().substring(0,3).equalsIgnoreCase("Bar"))
imagen.setBackgroundResource(R.drawable.bar);
else if(marker.getTitle().substring(0,3).equalsIgnoreCase("Res"))
imagen.setBackgroundResource(R.drawable.rest);
else
imagen.setVisibility(4);
return(popup);
}
我想在该方法中添加类似这样的内容:
popup.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(getApplicationContext(), InfoLocal.class);
startActivity(intent);
finish();
}
});
谢谢你的回答,对不起我的英语。