title: Dimmed Background of PopupWindow excludes Toolbars / Action Bars
body: <p>I use the following codes to create a <code>PopupWindow</code> with dim background by clicking a menu item in <code>Toolbar</code>:</p>
  
  <pre><code>@Override
  public boolean onOptionsItemSelected(MenuItem item) {
      switch(item.getItemId()) {
          case R.id.btn_1:
              Log.i(TAG, "Clicked Button 1");
              LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
              View popupView = layoutInflater.inflate(R.layout.popup_window, null);
  
              final PopupWindow popupWindow = new PopupWindow(popupView, Toolbar.LayoutParams.MATCH_PARENT, Toolbar.LayoutParams.MATCH_PARENT);
              Button btnDismiss = (Button)popupView.findViewById(R.id.btn_dismiss);
              btnDismiss.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      popupWindow.dismiss();
                  }
              });
              popupWindow.showAtLocation(popupView, Gravity.CENTER, 0, 0);
              return true;
          default:
              return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>However, I want to the dim background to exclude the action bars / toolbars. How can I achieve it?</p>
  
  <p>The layout of the <code>PopupView</code> is as follow:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;RelativeLayout
          android:id="@+id/bac_dim_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="#C0000000"
          android:visibility="visible" &gt;
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:layout_margin="1dp"
              android:background="@android:color/darker_gray"&gt;
              &gt;
              &lt;LinearLayout
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:orientation="vertical"
                  android:layout_margin="20dp"&gt;
                  &lt;TextView
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:text="It's a PopupWindow" /&gt;
                  &lt;Button
                      android:id="@+id/btn_dismiss"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:text="Dismiss" /&gt;
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>