title: Want to display all infowindow for all marker at a time
body: <p>I am creating custom infowindow for all marker because i want to display user icon in marker. I want to display all marker at a time open on marker in map but I am not able to do this.</p>
  
  <p>This is my code.</p>
  
  <pre><code>public class FriendMapActivity extends FragmentActivity implements
          InfoWindowAdapter {
      GoogleMap googleMap;
      Context context;
      Marker mMarker;
      public static int snip;
      public static String user_id;
      public static ArrayList&lt;String&gt; useridList, fullnameList, imageList,
              latiList, LongiLIst;
      Button btnBack;
      Bitmap bmImg;
      public ArrayList&lt;Marker&gt; marker;
      @SuppressLint("NewApi")
      @Override
      protected void onCreate(Bundle arg0) {
          // TODO Auto-generated method stub
          super.onCreate(arg0);
          requestWindowFeature(Window.FEATURE_NO_TITLE);
          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                  WindowManager.LayoutParams.FLAG_FULLSCREEN);
          setContentView(R.layout.activity_friend_map);
          if (android.os.Build.VERSION.SDK_INT &gt; 9) {
              StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
                      .permitAll().build();
              StrictMode.setThreadPolicy(policy);
          }
          btnBack = (Button) findViewById(R.id.btnBack);
          SharedPreferences prefers = this
                  .getSharedPreferences("LOGIN_DETAIL", 0);
          user_id = prefers.getString("USER_ID", "");
  
          SupportMapFragment supportMapFragment = (SupportMapFragment) getSupportFragmentManager()
                  .findFragmentById(R.id.Nearmap);
  
          // Getting a reference to the map
          GetUserDetailByUserId();
          googleMap = supportMapFragment.getMap();
          googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
          googleMap.setMyLocationEnabled(true);
  
  
          googleMap.setInfoWindowAdapter(new InfoWindowAdapter() {
  
              @Override
              public View getInfoWindow(Marker arg0) {
                  // TODO Auto-generated method stub
                  View v = getLayoutInflater().inflate(R.layout.activity_marker,
                          null);
                  LatLng latLng = arg0.getPosition();
                  snip = Integer.parseInt(arg0.getId().substring(1));
                  // Getting reference to the TextView to set latitude
                  ImageView imageicon = (ImageView) v
                          .findViewById(R.id.imagemarker);
                  // Getting reference to the TextView to set longitude
                  for (int i = 0; i &lt; latiList.size(); i++) {
                      try {
                          Bitmap bmp = BitmapFactory.decodeStream(new URL(
                                  imageList.get(snip)).openConnection()
                                  .getInputStream());
                          imageicon.setImageBitmap(bmp);
                          Picasso.with(FriendMapActivity.this)
                                  .load(imageList.get(snip))
                                  .transform(new CircleTransform())
                                  .into(imageicon);
                      } catch (IOException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                      }
                  }
                  return v;
              }
  
              @Override
              public View getInfoContents(Marker arg0) {
                  // TODO Auto-generated method stub
                   if (FriendMapActivity.this.mMarker != null
                              &amp;&amp; FriendMapActivity.this.mMarker.isInfoWindowShown()) {
                       //FriendMapActivity.this.mMarker.hideInfoWindow();
  
                       FriendMapActivity.this.mMarker.showInfoWindow();
                          for(int i=0;i&lt;marker.size();i++)
                          {
                               FriendMapActivity.this.mMarker.showInfoWindow();
                          }
                      }
                      return null;
  
              }
          });
  
          btnBack.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  finish();
              }
          });
  
          // GetUserDetailByUserId();
      }
  
      @Override
      protected void onStart() {
          // TODO Auto-generated method stub
          super.onStart();
      }
  
      @Override
      protected void onStop() {
          // TODO Auto-generated method stub
          super.onStop();
      }
  public void GetUserDetailByUserId() {
          new AsyncTask&lt;Void, Void, String&gt;() {
              ProgressDialog mProgressDialog;
  
              @SuppressWarnings("deprecation")
              @Override
              protected String doInBackground(Void... params) {
                  // TODO Auto-generated method stub
  
                  HttpClient httpclient = new DefaultHttpClient();
                  HttpPost httppost = new HttpPost(
                          "url of server is here");
                  marker = new ArrayList&lt;Marker&gt;();
                  try {
  
                      List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(
                              2);
                      nameValuePairs.add(new BasicNameValuePair("action",
                              "GetUserDetailByUserId"));
  
                      nameValuePairs.add(new BasicNameValuePair("userid", String
                              .valueOf(5)));
  
                      httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                      // Execute HTTP Post Request
                      HttpResponse response = httpclient.execute(httppost);
                      BufferedReader in = new BufferedReader(
                              new InputStreamReader(response.getEntity()
                                      .getContent()));
                      StringBuffer sb = new StringBuffer("");
                      String line = "";
                      while ((line = in.readLine()) != null) {
                          sb.append(line);
                      }
                      in.close();
                      Log.e("get user want to Data", "" + sb.toString());
                      return sb.toString();
                  } catch (Exception e) {
                      Log.e("get user problem", "" + e);
                      return "";
                  }
              }
  
              @Override
              protected void onPostExecute(String result) {
                  // TODO Auto-generated method stub
                  super.onPostExecute(result);
                  useridList = new ArrayList&lt;String&gt;();
                  fullnameList = new ArrayList&lt;String&gt;();
                  imageList = new ArrayList&lt;String&gt;();
                  latiList = new ArrayList&lt;String&gt;();
                  LongiLIst = new ArrayList&lt;String&gt;();
  
                  try {
                      mProgressDialog.dismiss();
                      JSONObject object = new JSONObject(result.toString());
                      if (object.getString("msg").equalsIgnoreCase("Success")) {
                          JSONArray array = object.getJSONArray("data");
                          for (int j = 0; j &lt; array.length(); j++) {
                              JSONObject subObj = array.getJSONObject(j);
                              useridList.add(subObj.getString("userid"));
                              fullnameList.add(subObj.getString("fullname"));
                              imageList.add(subObj.getString("image_url"));
                              latiList.add(subObj.getString("latitude"));
                              LongiLIst.add(subObj.getString("longitude"));
                              Log.d("val of userid list:", useridList.toString());
                          }
                          for (int i = 0; i &lt; latiList.size(); i++) {
                              takeToLocation(new LatLng(
                                      Double.parseDouble(latiList.get(i)),
                                      Double.parseDouble(LongiLIst.get(i))));
                              MarkerOptions markerOptions = new MarkerOptions()
                                      .position(
                                              new LatLng(Double
                                                      .parseDouble(latiList
                                                              .get(i)), Double
                                                      .parseDouble(LongiLIst
                                                              .get(i))))
                                      .icon(BitmapDescriptorFactory
                                              .fromResource(R.drawable.blue_dot));
                              // // Bitmap circleBitmap =
                              // Bitmap.createBitmap(200,200,
                              // Bitmap.Config.ARGB_8888);
                              // // Bitmap bmp =
                              // Bitmap.createBitmap(circleBitmap);
                              // // Canvas canvas1 = new Canvas(bmp);
                              // //
                              // // // paint defines the text color,
                              // // // stroke width, size
                              // // Paint color = new Paint();
                              // // color.setTextSize(12);
                              // // color.setColor(Color.BLACK);
                              // // Bitmap yourBitmap;
                              //
                              //
                              // URL url = new URL(imageList.get(i));
                              // HttpURLConnection conn = (HttpURLConnection)
                              // url.openConnection();
                              // conn.setDoInput(true);
                              // conn.connect();
                              // InputStream is = conn.getInputStream();
  
                              // bmImg = BitmapFactory.decodeStream(is);
  
                              // Bitmap resized = Bitmap.createScaledBitmap(bmImg,
                              // 100, 100, true);
                              // //modify canvas
                              // // canvas1.drawBitmap(
                              // // getCircularBitmapImage(bmImg), 0,0, color);
                              // // canvas1.drawText(fullnameList.get(i), 30, 40,
                              // color);
                              //
                              // //add marker to Map
  //                           googleMap.addMarker(new
  //                           MarkerOptions().position(new
  //                           LatLng(Double.parseDouble(latiList.get(i)),
  //                           Double.parseDouble(LongiLIst.get(i))))
  //                           .icon(BitmapDescriptorFactory.fromBitmap(getCircularBitmapImage(bmImg)))
  //                           // Specifies the anchor to be at a particular
  //                      
  //                           .anchor(0.5f, 1));
                               marker.add(mMarker);
  
                              mMarker = googleMap.addMarker(markerOptions);
                              mMarker.setTitle("Click Me:");
                              for(i=0;i&lt;marker.size();i++)
                              {
                                mMarker.showInfoWindow();
                              }
                              //mMarker.isInfoWindowShown();
  //                          showAllMarker(i);
  
                          }
  
                      } else {
                          System.out.println("not a valid user");
                      }
  
                  } catch (Exception e) {
                      Log.e("json error in gettripexperience", "" + e);
  
                  }
  
              }
  
              @Override
              protected void onPreExecute() {
                  // TODO Auto-generated method stub
                  super.onPreExecute();
                  mProgressDialog = new ProgressDialog(FriendMapActivity.this);
                  mProgressDialog.setTitle("");
                  mProgressDialog.setCanceledOnTouchOutside(false);
                  mProgressDialog.setMessage("Please Wait...");
                  mProgressDialog.show();
  
              }
          }.execute();
      }
  
      @Override
      public View getInfoContents(Marker arg0) {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Override
      public View getInfoWindow(Marker arg0) {
          // TODO Auto-generated method stub
          View v = getLayoutInflater().inflate(R.layout.activity_marker, null);
          LatLng latLng = arg0.getPosition();
          // Getting reference to the TextView to set latitude
          ImageView tvLat = (ImageView) v.findViewById(R.id.imagemarker);
          // Getting reference to the TextView to set longitude
  
          return v;
      }
  
      public void takeToLocation(LatLng toBeLocationLatLang) {
          if (toBeLocationLatLang != null) {
              CameraUpdate update = CameraUpdateFactory.newLatLngZoom(
                      toBeLocationLatLang, 16);
              googleMap.animateCamera(update);
          } else {
              Toast.makeText(this, "Position Unavailable", Toast.LENGTH_SHORT)
                      .show();
          }
      }
  
      public static Bitmap getCircularBitmapImage(Bitmap source) {
          int size = Math.min(source.getWidth(), source.getHeight());
          int x = (source.getWidth() - size) / 2;
          int y = (source.getHeight() - size) / 2;
          Bitmap squaredBitmap = Bitmap.createBitmap(source, x, y, size, size);
          if (squaredBitmap != source) {
              source.recycle();
          }
          Bitmap bitmap = Bitmap
                  .createBitmap(size, size, Bitmap.Config.ARGB_8888);
          Canvas canvas = new Canvas(bitmap);
          Paint paint = new Paint();
          BitmapShader shader = new BitmapShader(squaredBitmap,
                  BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP);
          paint.setShader(shader);
          paint.setAntiAlias(true);
          float r = size / 6f;
          canvas.drawCircle(r, r, r, paint);
          squaredBitmap.recycle();
          return bitmap;
      }
  
      public class CircleTransform implements Transformation {
          @Override
          public Bitmap transform(Bitmap source) {
              int size = Math.min(source.getWidth(), source.getHeight());
  
              int x = (source.getWidth() - size) / 2;
              int y = (source.getHeight() - size) / 2;
  
              Bitmap squaredBitmap = Bitmap
                      .createBitmap(source, x, y, size, size);
              if (squaredBitmap != source) {
                  source.recycle();
              }
  
              Bitmap bitmap = Bitmap.createBitmap(size, size, source.getConfig());
  
              Canvas canvas = new Canvas(bitmap);
              Paint paint = new Paint();
              BitmapShader shader = new BitmapShader(squaredBitmap,
                      BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP);
              paint.setShader(shader);
              paint.setAntiAlias(true);
  
              float r = size / 2f;
              canvas.drawCircle(r, r, r, paint);
  
              squaredBitmap.recycle();
              return bitmap;
          }
  
          // protected Bitmap transform(BitmapPool pool, Bitmap source,
          // int outWidth, int outHeight) {
          // return getCircularBitmapImage(source);
          // }
  
          public String getId() {
              return "Glide_Circle_Transformation";
          }
  
          @Override
          public String key() {
              // TODO Auto-generated method stub
              return "circle";
          }
  
      }
  //  function generateInfoWindow(despacedName, despacedTitle, eventTitle, url, date, time){
  //      if(!curInfoWindow){
  //          curInfoWindow = new google.maps.InfoWindow({maxWidth:150});
  //      }
  //      curInfoWindow.setContent("&lt;a class=\"eventLink\" href=\""+url+"\"&gt;"+eventTitle+"&lt;/a&gt;&lt;br&gt;&lt;br&gt;"+markerObjects[despacedName].title+"&lt;br&gt;"+date+" at "+time);
  //      curInfoWindow.open(map, markerObjects[despacedName]);
  //      alert(despacedName+" is "+markerObjects[despacedName]);
  //  }
  
      public void showAllMarker(int pos) {
          MarkerOptions markerOptions = new MarkerOptions().position(
                  new LatLng(Double.parseDouble(latiList.get(pos)), Double
                          .parseDouble(LongiLIst.get(pos)))).icon(
                  BitmapDescriptorFactory.fromResource(R.drawable.blue_dot));
          mMarker = googleMap.addMarker(markerOptions);
          if (mMarker.isInfoWindowShown()) {
              Log.d("marker:", mMarker.getId());
          } else {
              mMarker.showInfoWindow();
          }
      }
  </code></pre>