title: Change Visibilty of imageviews in alertdialog-Android
body: <p>I'm trying to build an custom alertdialog in which there are 3 <code>ImageViews</code> .I want to hide and show these <code>ImageViews</code> dynamically.Here is my showroute() in HomeActivity class in which i'm creating the custom dialog.</p>
  
  <pre><code>AlertDialog.Builder alertDialog = new AlertDialog.Builder(HomeActivity.this);
      alertDialog.setView(getLayoutInflater().inflate(R.layout.routedialog, null));
      alertDialog.setTitle("Home Activity");
      alertDialog.setIcon(R.drawable.logo);
      alertDialog.setMessage(Html.fromHtml("&lt;b&gt;Route Details&lt;/b&gt;"));
      ImageView iv1,iv2,iv3;
      LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
      View convertView = (LinearLayout) inflater.inflate(R.layout.routedialog, null);
      iv1=(ImageView) convertView.findViewById(R.id.iv1);
      iv2=(ImageView) convertView.findViewById(R.id.iv2);
      iv3=(ImageView) convertView.findViewById(R.id.iv3);
  
  
      iv1.setVisibility(View.GONE);
      iv2.setVisibility(View.GONE);
      iv3.setVisibility(View.GONE);
  
      convertView.findViewById(R.id.ll).invalidate();
  </code></pre>
  
  <p>and here is my routedialog.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/ll"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:padding="10dp" &gt;
   &lt;ImageView
              android:id="@+id/iv1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:src="@drawable/ivred" /&gt;
    &lt;ImageView
              android:id="@+id/iv2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:src="@drawable/ivblue" /&gt;
    &lt;ImageView
              android:id="@+id/iv3"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:src="@drawable/ivgreen" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I want these <code>ImageViews</code> to be hidden when the dialog manager pops up and has to be made visible dynamically after checking certain conditions.Please Help.</p>