change style (using variable)
<p>I've this code and I need to change MyCustonTheme1 to 2 or 3 or 4 (From a value by sharedpreferences, user choose a value (1,2,3,4)</p>

<pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.MyCustomTheme1);
</code></pre>

<p>In MainActivity I've:</p>

<pre><code>if (fade == 500){
            animazione = "R.style.MyCustomTheme1";
        }
        if (fade == 1000){
            animazione = "R.style.MyCustomTheme2";
        }
            [...]
</code></pre>

<p>Now, I need put "animazione" like this code:</p>

<pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this, animazione);
</code></pre>

<p>The constructor AlertDialog.Builder(MainActivity, String) is undefined</p>

<p>Is it possibile change R.style.MyCustomTheme1 to variable like "animazione"?</p>

<p>thanks!</p>
