public class CustomInfoWindowAdapter implements InfoWindowAdapter{
private static final String TAG = "CustomInfoWindowAdapter";
private LayoutInflater inflater;
public CustomInfoWindowAdapter(LayoutInflater inflater){
this.inflater = inflater;
}
@Override
public View getInfoContents(final Marker m) {
//Carga layout personalizado.
View v = inflater.inflate(R.layout.infowindow_layout, null);
String[] info = m.getTitle().split("&");
String url = m.getSnippet();
((TextView)v.findViewById(R.id.info_window_nombre)).setText("Lina CortésCortés");
((TextView)v.findViewById(R.id.info_window_placas)).setText("Placas: SRX32");
((TextView)v.findViewById(R.id.info_window_estado)).setText("Estado: Activo");
return v;
}
@Override
public View getInfoWindow(Marker m) {
return null;
}
}
Finalmente para cargar el infoWindow personalizado, a tu instancia GoogleMap mediante el método [setInfoWindowAdapter()][3]
setInfoWindowAdapter()
le asignas el InfoWindowAdapter
personalizado.