I'm trying click into a "Window" of Google Maps, but my button doesn't work, I think that is problem of the handler, because it is encapsulated "@listener" (android not work correctly) but I don't know exactly.
My code to click is here :
googleMap.setInfoWindowAdapter(new InfoWindowAdapter() {
// Use default InfoWindow frame
@Override
public View getInfoWindow(Marker arg0) {
return null;
}
// Defines the contents of the InfoWindow
@Override
public View getInfoContents(Marker arg0) {
View v = getLayoutInflater().inflate(R.layout.windowlayout, null);
LatLng latLng = arg0.getPosition();
TextView tvLat = (TextView) v.findViewById(R.id.tv_lat);
TextView tvLng = (TextView) v.findViewById(R.id.tv_lng);
tvLat.setText("Latitude:" + latLng.latitude);
tvLng.setText("Longitude:"+ latLng.longitude);
Button btn = (Button)v.findViewById(R.id.btn); // Here my button not work
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(GoogleMapActivaFind.this, "wow", Toast.LENGTH_SHORT).show();
}
});
return v;
}
});