title: Android transparent DialogFragment
body: <p>I have a dialog fragment which is shown when the WidgetConfig activity is running. The dialog shows a list of which the user can choose some items. I want this dialog to be transparent so that you can see the home screen in the background of the dialog. This is what I currently do inside WidgetConfig activity:</p>
  
  <pre><code>    DialogFragment dialog = new myChooserDialog();  
      getWindow().requestFeature(Window.FEATURE_NO_TITLE);
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 
      getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));        
      dialog.show(getFragmentManager(), "dialog");    
  </code></pre>
  
  <p>EDIT: The code of myChooserDialog:</p>
  
  <pre><code>public class MyChooserDialog extends DialogFragment{
  
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
          choices = getResources().getStringArray(R.array.city_choices);
          AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());       
          builder.setTitle(getResources().getString(R.string.widget_dialog_chooser_title));
          builder.setPositiveButton(getResources().getString(R.string.widget_dialog_chooser_posBtn), this);
          builder.setNegativeButton(getResources().getString(R.string.widget_dialog_chooser_negBtn), this);   
          builder.setSingleChoiceItems(choices, -1, this);
          return builder.create();
      }
  
  
      @Override
      public void onClick(DialogInterface dialog, int which) {
          switch (which) {
          case DialogInterface.BUTTON_POSITIVE:   
              //doing magic tricks
              break;
  
          case DialogInterface.BUTTON_NEGATIVE:
              dialog.dismiss();
              break;
  
          default:
              //more magic
              break;
          }   
      }
  }
  </code></pre>
  
  <p>Currently, the background is all black. What am I doing wrong here?</p>
  
  <p>Marcus</p>