title: Programmatically set android:windowIsTranslucent
body: <p>I was able to create a floating activity after following this tutorial <a href="http://cases.azoft.com/android-tutorial-floating-activity/" rel="nofollow">http://cases.azoft.com/android-tutorial-floating-activity/</a></p>
  
  <p>However, to do so, I had to add this line in <code>styles.xml</code> :</p>
  
  <pre><code>&lt;item name="android:windowIsTranslucent"&gt;true&lt;/item&gt;
  </code></pre>
  
  <p>Is it possible to have the same effect using only Android/Java code ? (e.g. in <code>Activity.onAttachedToWindow()</code> or so...)</p>
  
  <p>Thanks in advance for your help.</p>
  
  <p><strong>[EDIT 01]</strong> <code>styles.xml</code> must not be changed (and I'm not supposed to know what's in it...). But for testing purposes, I'm using the default one:</p>
  
  <pre><code>&lt;resources&gt;
      &lt;style name="AppBaseTheme" parent="Theme.AppCompat.Light"&gt;
      &lt;/style&gt;
      &lt;style name="AppTheme" parent="AppBaseTheme"&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p><strong>[EDIT 02]</strong> <a href="http://developer.android.com/reference/android/content/res/Resources.Theme.html" rel="nofollow"> Resources.Theme.applyStyle() </a> seems to do what I want (according to the API description: <em>"Place new attribute values into the theme"</em> ).
  So I created the following <code>custom_style.xml</code> :</p>
  
  <pre><code>&lt;resources&gt;
      &lt;style name="MyCustomStyle" &gt;
          &lt;item name="android:windowIsTranslucent"&gt;true&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>Then, in <code>onAttachedToWindow()</code> , I called:</p>
  
  <pre><code>getTheme().applyStyle(R.style.MyCustomStyle, true);
  </code></pre>
  
  <p>But it didn't have any effect...</p>