title: how to set popup window at the bottom of all screen size in Android?
body: <p>I creating  camerapopup.xml in my application . I want to display this pop up window at the bottom of screen for all screen size . I have tried to creating different layout folders (layout-large , layout-small,layoutxlarge etc )but does not work at all How to set the popup window for all screen size at the bottom .Can someone help me how to work with that.Thanks in advanced .</p>
  
  <p>Here is my xml file .</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/popup_element"
      android:layout_width="fill_parent"
      android:layout_height="180dp"
      android:background="@android:color/transparent"
      android:orientation="vertical"
      android:padding="3dp"&gt;
  
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="1dp"
          android:background="@android:color/transparent"
          android:orientation="vertical"&gt;
  
          &lt;TextView
              android:id="@+id/Title"
              android:layout_width="fill_parent"
              android:layout_height="40dp"
              android:layout_gravity="center_horizontal"
              android:layout_weight="1"
              android:background="@drawable/curve_shap"
              android:gravity="center_horizontal|center_vertical"
              android:text="Take Photo"
              android:textAppearance="?android:attr/textAppearanceMedium"
              android:textColor="@android:color/darker_gray"
              android:textSize="14sp" /&gt;
  
          &lt;Button
              android:id="@+id/button_Camera"
              android:layout_width="fill_parent"
              android:layout_height="40dp"
  
              android:layout_gravity="center_horizontal"
              android:layout_weight="1"
              android:background="@drawable/curve_shap"
              android:text="Camera"
              android:textColor="#3A86CF" /&gt;
  
          &lt;Button
              android:id="@+id/button_Gallery"
              android:layout_width="fill_parent"
              android:layout_height="40dp"
              android:layout_gravity="center_horizontal"
              android:layout_weight="1"
              android:background="@drawable/curve_shap"
              android:text="Gallery"
              android:textColor="#3A86CF" /&gt;
  
  
      &lt;/LinearLayout&gt;
  
      &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="45dp"
          android:layout_marginTop="4dp"
          &gt;
  
          &lt;Button
              android:id="@+id/btnCancelCamera"
              android:layout_width="fill_parent"
              android:layout_height="40dp"
              android:layout_gravity="center_horizontal"
  
              android:background="@drawable/curve_shap"
              android:text="Cancel"
              android:textColor="#3A86CF"
              android:textSize="16sp"
              android:textStyle="bold" /&gt;
      &lt;/RelativeLayout&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is my Activity code </p>
  
  <pre><code>imgProfilePic.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
   LayoutInflater layoutInflater = (LayoutInflater) getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
                  View popupView = layoutInflater.inflate(R.layout.camera_popup, (ViewGroup) findViewById(R.id.popup_element));
                  popupWindow = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
                  popupWindow.setWidth(720);
                  popupWindow.setHeight(350);
                  popupWindow.setFocusable(true);
                  popupWindow.showAtLocation(popupView, Gravity.BOTTOM, 0, 0);
                  popupWindow.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
  
                  Button btnCamera = (Button) popupView.findViewById(R.id.button_Camera);
                  Button btnGallery = (Button) popupView.findViewById(R.id.button_Gallery);
                  Button btnDismiss = (Button) popupView.findViewById(R.id.btnCancelCamera);
  }
          });
  </code></pre>