title: Issue with an icon on Android's PopupWindow
body: <p>I have an app in which I'm opening a PopupWindow, with a couple of images, a text box and an icon of a trash bin below the tex box.</p>
  
  <p>The problem is when I'm presenting the PopupWindow, sometimes when I'm opening the window the icon seems small, and on other times (most of the times) the icon seems as I defined it.</p>
  
  <pre><code>popUpView = inflater.inflate(R.layout.activity_packpresent, (ViewGroup)ma.findViewById(R.layout.activity_main));
  
  pw = new PopupWindow(
          popUpView,
          ma.f.getView().getMeasuredWidth(), //400
          ma.f.getView().getMeasuredHeight(), //800
          true);
  pw.setOnDismissListener(new PopupWindow.OnDismissListener() {
      @Override
      public void onDismiss() {
          System.out.println("Dismissed!!");
  
          Handler handler = new Handler();
          handler.post(new Runnable() {
  
              @Override
              public void run() {
                  //MainActivity.packButton.setVisibility(View.VISIBLE);
                  try {
                      image.recycle();
                  } catch (Exception e) {
                  }
                  ma.handlePopUpDissmiss();
              }
          });
      }
  });
  
  trash = (ImageButton)popUpView.findViewById(R.id.trashBin);
  trash.getLayoutParams().height = (int)((MainActivity.wantedPicSize)*(3.0/4.0));
  trash.getLayoutParams().width = (int)((MainActivity.wantedPicSize)*(3.0/4.0));
  
  pw.showAtLocation(map, Gravity.BOTTOM, 0, 0);
  pw.update();
  </code></pre>
  
  <p>The layout:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:facebook="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/lID"&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/rID"
          android:background="@drawable/back5"&gt;
  
          &lt;ImageView
              android:layout_width="125px"
              android:layout_height="200px"
              android:id="@+id/mImageView"
              android:background="@drawable/com_facebook_picker_default_separator_color"
              android:layout_centerVertical="true"
              android:layout_centerHorizontal="true" /&gt;
  
          &lt;EditText
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/editText"
              android:layout_below="@+id/mImageView"
              android:layout_marginTop="50dp"
              android:editable="false"
              android:visibility="visible"
              android:layout_alignRight="@+id/imageViewR"
              android:layout_alignEnd="@+id/imageViewR"
              android:layout_alignLeft="@+id/imageViewL"
              android:layout_alignStart="@+id/imageViewL" /&gt;
  
          &lt;ImageView
              android:layout_width="125px"
              android:layout_height="200px"
              android:id="@+id/imageViewRR"
              android:background="@drawable/com_facebook_picker_default_separator_color"
              android:layout_alignTop="@+id/imageViewR"
              android:layout_toRightOf="@+id/button" /&gt;
  
          &lt;ImageView
              android:layout_width="125px"
              android:layout_height="200px"
              android:id="@+id/imageViewLL"
              android:background="@drawable/com_facebook_picker_default_separator_color"
              android:layout_alignTop="@+id/imageViewL"
              android:layout_toLeftOf="@+id/button" /&gt;
  
          &lt;ImageView
              android:layout_width="125px"
              android:layout_height="200px"
              android:id="@+id/imageViewR"
              android:background="@drawable/com_facebook_picker_default_separator_color"
              android:layout_alignTop="@+id/mImageView"
              android:layout_toRightOf="@+id/mImageView" /&gt;
  
          &lt;ImageView
              android:layout_width="125px"
              android:layout_height="200px"
              android:id="@+id/imageViewL"
              android:background="@drawable/com_facebook_picker_default_separator_color"
              android:layout_above="@+id/editText"
              android:layout_toLeftOf="@+id/mImageView" /&gt;
  
          &lt;GridView
              android:layout_width="300dp"
              android:layout_height="300dp"
              android:id="@+id/gridView"
              android:layout_above="@+id/mImageView"
              android:layout_centerHorizontal="true"
              android:visibility="invisible"
              android:layout_marginBottom="10dp"
              android:layout_below="@+id/button2" /&gt;
  
          &lt;Button
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="New Button"
              android:id="@+id/button"
              android:layout_below="@+id/editText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="70dp"
              android:visibility="invisible" /&gt;
  
          &lt;ImageView
              android:layout_width="wrap_content"
              android:layout_height="10dp"
              android:id="@+id/imageView"
              android:layout_centerHorizontal="true"
              android:layout_marginBottom="10dp"
              android:layout_alignRight="@+id/imageViewRR"
              android:background="@drawable/line"
              android:layout_alignLeft="@+id/imageViewLL"
              android:layout_below="@+id/gridView" /&gt;
  
          &lt;Button
              android:layout_width="wrap_content"
              android:layout_height="20dp"
              android:text="New Button"
              android:id="@+id/button2"
              android:layout_alignParentTop="true"
              android:layout_toLeftOf="@+id/imageViewRR"
              android:visibility="invisible" /&gt;
  
          &lt;ImageButton
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:id="@+id/trashBin"
              android:layout_below="@+id/editText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="10dp"
              android:background="@drawable/trash_bin" /&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>