Please tell me how to display text without a final String in InfoWindow, otherwise all the markers will be with the same text. I need to display in the InfoWindow order 3-4 different lines. Below is a snippet of code from the screen.
public void onChildAdded(DataSnapshot dataSnapshot, String prevChildKey) { if(dataSnapshot.child("latitude").getValue() != null && dataSnapshot.child("longitude").getValue() != null) { double latt = dataSnapshot.child("latitude").getValue(Double.class); double longg = dataSnapshot.child("longitude").getValue(Double.class); LatLng newLocation = new LatLng(latt, longg); String sname = (String) dataSnapshot.child("sname").getValue(); String text = (String) dataSnapshot.child("text").getValue(); String Number = (String) dataSnapshot.child("number").getValue(); String image = dataSnapshot.child("image").getValue(String.class); if (image.equals("akym")) { mMap.addMarker(new MarkerOptions() .position(newLocation) .title(sname) .snippet("Номер:"+Number+"\n"+"Описание:"+text) .icon(BitmapDescriptorFactory.fromResource(R.mipmap.akym)) ); mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() { @Override public View getInfoWindow(Marker arg0) { return null; } @Override public View getInfoContents(Marker marker) { View myContentView = getLayoutInflater().inflate( R.layout.custommarker, null); TextView tvTitle = ((TextView) myContentView .findViewById(R.id.title)); tvTitle.setText(Number); TextView tvSnippet = ((TextView) myContentView .findViewById(R.id.snippet)); tvSnippet.setText(marker.getSnippet()); return myContentView; } }); PS I know that the code is terrible, but I'm learning)

InfoWindowAdapteronce, and transfer the data for display throughsetTag/getTagfromMarker( example ). - zRrr 4:39 pm