title: Create a transparent dialog on top of activity
body: <h2>Background</h2>
  
  <p>I'm trying to put a layer on top of the current activity which would have explanation of what is going on on the current screen, similar to what occurs on <a href="https://play.google.com/store/apps/details?id=com.contapps.android" rel="noreferrer">contact+ app</a> .</p>
  
  <p>I know there are some solutions for this (like the <a href="https://stackoverflow.com/questions/17972903/alternative-to-showcase-library-for-app-user-tutorials">showCase library</a> and the superToolTips  library ) , and I also know that I can create a view and set it on top by adding it to the window of the activity , but I need put a whole dialog layer on top.</p>
  
  <h2>Problem</h2>
  
  <p>No matter what I try, each solution doesn't work the way I need it to work.</p>
  
  <p>in short , what I need is:</p>
  
  <ul>
  <li><p>full screen dialog.</p></li>
  <li><p>no change (not visual and not logical) to the action bar, notification bar, and content of the activity behind, meaning that everything behind the dialog stays the same it was shown a moment before the dialog was shown.</p></li>
  <li><p>be transparent except for the views I use for the dialog, which should be shown normally.</p></li>
  </ul>
  
  <h2>what I've tried</h2>
  
  <p>Sadly, I've always got only a part of the things I needed.</p>
  
  <p>here's my code:</p>
  
  <p>styles.xml:</p>
  
  <pre><code>&lt;style name="full_screen_dialog"&gt;
          &lt;item name="android:windowFrame"&gt;@null&lt;/item&gt;
          &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt;
          &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt;
          &lt;item name="android:windowAnimationStyle"&gt;@android:style/Animation.Dialog&lt;/item&gt;
          &lt;item name="android:windowSoftInputMode"&gt;stateUnspecified|adjustPan&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>MainActivity.java:</p>
  
  <pre><code>...
  final Dialog dialog = new Dialog(this, R.style.full_screen_dialog);
  dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
  dialog.setContentView(R.layout.floating_tutorial);
  dialog.getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
  dialog.getWindow().setFormat(PixelFormat.TRANSLUCENT);
  dialog.show();
  </code></pre>
  
  <p>This code will put the layout on top of the activity, but sadly it doesn't have any transparency , even though I've set it . The layout I've used is very simple which is why I don't post it.</p>
  
  <h2>Question</h2>
  
  <p>what am I missing ? what should be done to fix the code? </p>
  
  <p>how can I make the dialog both transparent, full screen AND that it won't change the action bar and notifications bar.</p>
  
  <hr>
  
  <h2>Working solution</h2>
  
  <p>EDIT: after finding a good solution, here's the working code:</p>
  
  <pre><code>@Override
  protected void onCreate(final Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      final Dialog dialog = new Dialog(this);
      dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
      dialog.setContentView(R.layout.floating_tutorial);
      final Window window = dialog.getWindow();
      window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
      window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
      window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
      dialog.show();
  }
  </code></pre>