title: "The specified child already has a parent" How can I remove view from AlertDialog
body: <p>I am inflating a LinearLayout into an AlertDialog. it works fine but if I dismis it and launch it again it gives me the following error</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: The specified child already has a
    parent. You must call removeView() on the child's parent first.</p>
  </blockquote>
  
  <p>in the contructor:</p>
  
  <pre><code>infoWindow = (LinearLayout) ((Activity) context).getLayoutInflater().inflate(R.layout.map_info_content, null);
  </code></pre>
  
  <p>later:</p>
  
  <pre><code>protected boolean onTap(int index) {
          Builder dialog = new AlertDialog.Builder(context);
          dialog.setView(infoWindow);
          dialog.show();
          return true;
      }
  </code></pre>
  
  <p>I have tried to keep the dialog  in memory and setting it's view as null but it didn't fix the problem</p>