title: How to Change background of popup layout?
body: <p>I have created a popup and I have set one background of popup.
  My xml file is as below. I want to change background of popup window.</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"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@drawable/pp1" &gt;
  
  &lt;WebView
      android:id="@+id/webview1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginBottom="30dp"
      android:layout_marginLeft="35dp"
      android:layout_marginRight="35dp"
      android:layout_marginTop="30dp" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>My showPopup method is as below. So how can I change my popup background? and also I load a webview in popup window.</p>
  
  <pre><code>    private void showPopup(final Activity context, Point p) {
      int popupWidth = 720;
      int popupHeight = 380;
  
      // Inflate the popup_layout.xml
      LinearLayout viewGroup = (LinearLayout) context
              .findViewById(R.id.popup);
      LayoutInflater layoutInflater = (LayoutInflater) context
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      View layout = layoutInflater.inflate(R.layout.popup_layout, viewGroup);
      if (i == 1) {
          WebView wv = (WebView) layout.findViewById(R.id.webview1);
          wv.loadUrl("file:///android_asset/aboutus.html");
      }
      /*
       * Resources res = getResources(); Drawable drawable =
       * res.getDrawable(R.drawable.newImage); LinearLayout linearLayout =
       * (LinearLayout)findViewById(R.id.GameLayout);
       * linearLayout.setBackgroundDrawable(drawable);
       */
  
      // Creating the PopupWindow
      final PopupWindow popup = new PopupWindow(context);
      popup.setContentView(layout);
      popup.setWidth(popupWidth);
      popup.setHeight(popupHeight);
      popup.setFocusable(true);
  
      // Some offset to align the popup a bit to the right, and a bit down,
      // relative to button's position.
      int OFFSET_X = 130;
      int OFFSET_Y = 100;
      // Clear the default translucent background
      // popup.setBackgroundDrawable(new BitmapDrawable());
  
      // Displaying the popup at the specified location, + offsets.
      popup.showAtLocation(layout, Gravity.NO_GRAVITY, p.x + OFFSET_X, p.y
              + OFFSET_Y);
  
      // Getting a reference to Close button, and close the popup when
      // clicked.
  
  }
  </code></pre>