Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you want to know about themes and styles, see this link of android developer : <a href="http://developer.android.com/guide/topics/ui/themes.html" rel="nofollow noreferrer">http://developer.android.com/guide/topics/ui/themes.html</a></p> <p>build two styles and then give the value of setting from prefrence and switch between theme , you can set themes programmatically in your activity with this code : <code>setTheme(R.style.MyTheme);</code></p> <p>You can do this with the following code in your themes.xml file in the values folder:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;style name="MyTheme" parent="@android:style/Theme.Light"&gt; &lt;!-- hide the Window Title --&gt; &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>And you can have a ListPreference with this code and add your string arrays in String.xml :</p> <pre><code> &lt;ListPreference android:title="List Preference" android:summary="Select the option of the list" android:key="listPref" android:entries="@array/listDisplayWord" android:entryValues="@array/listReturnValue" /&gt; </code></pre> <p>This link is useful for you : <a href="https://stackoverflow.com/q/5998565/1105277">How to add multiple theme attributes to the same activity on Android Manifest?</a></p> <p>You can use a value that give from your listPreference and switch between your layout, like this : </p> <pre><code>if(myTheme==1) setContentView(R.layout.main1); else setContentView(R.layout.main2); </code></pre> <p>but the name of components(buttons,textViews, EditText,...) in the these layout must same.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload