First of all put your Map.setInfoWindowAdapter(new poisInfoWindowAdapter());
outside your for loop in onPostExecute(....)
and second implement your poisInfoWindowAdapter()
like below:
public class poisInfoWindowAdapter implements InfoWindowAdapter {
@Override
public View getInfoWindow(Marker arg) {
return null;
}
@Override
public View getInfoContents(Marker marker) {
//Get Layout of POI's popups and assign values to text views.
View InfoPopupLayout = getLayoutInflater().inflate(R.layout.infopopup, null);
TextView t = (TextView)InfoPopupLayout.findViewById(R.id.title);
t.setText(marker.getTitle());
TextView t2 = (TextView)InfoPopupLayout.findViewById(R.id.title2);
t2.setText(marker.getSnippet());
return InfoPopupLayout;
}
}
Update: set Marker
as
Currnt = mMap.addMarker(new MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(R.drawable.mark_red))
.position(new LatLng(latitude,longitude)
.title(locations)
.snippet(city));