Rotate a single RotateDrawable in a LayerDrawable
<p>I'm building an app that has some sort of compass in it, and I want to use a LayerDrawable to draw and animate the compass. The LayerDrawable consists of a static background image for the compass background, and a RotateDrawable for the rotating part. Here's my XML code for the drawable resources:</p>

<p>compass_text.xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;rotate xmlns:android="http://schemas.android.com/apk/res/android" 
    android:drawable="@drawable/compasstext"
    android:fromDegrees="0"
    android:toDegrees="360"
    android:pivotX="50%"
    android:pivotY="50%" /&gt;
</code></pre>

<p>compass_layers.xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt;
    &lt;item android:drawable="@drawable/compassbackground" /&gt;
    &lt;item android:drawable="@drawable/compass_text" /&gt;
&lt;/layer-list&gt;
</code></pre>

<p>The LayerDrawable displays just fine, but how do I rotate it? This is the code I tried:</p>

<pre><code>compassText = (RotateDrawable)getResources().getDrawable(R.drawable.compass_text);
compassText.setLevel(5000);
</code></pre>

<p>This does nothing. What am I doing wrong?</p>
