Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To change the led color: <a href="https://stackoverflow.com/questions/6169291/changing-led-color-for-notifications">Check this link </a></p> <p>For the BATTERY_LOW you will ned a broadcastreceiver: <a href="http://www.tutorialforandroid.com/2009/01/getting-battery-information-on-android.html" rel="nofollow noreferrer">Check this link</a></p> <p>Ok.</p> <p>First, create a file in the values folder. Call it something like "preference_res.xml". Then add the following:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;string-array name="prefColor"&gt; &lt;item&gt;None&lt;/item&gt; &lt;item&gt;Blue&lt;/item&gt; &lt;item&gt;Green&lt;/item&gt; &lt;item&gt;Yellow&lt;/item&gt; &lt;item&gt;Other Color&lt;/item&gt; &lt;/string-array&gt; &lt;string-array name="prefColorVal"&gt; &lt;item&gt;-1&lt;/item&gt; &lt;item&gt;-2&lt;/item&gt; &lt;item&gt;79&lt;/item&gt; &lt;item&gt;24&lt;/item&gt; &lt;item&gt;25&lt;/item&gt; &lt;item&gt;27&lt;/item&gt; &lt;item&gt;80&lt;/item&gt; &lt;/string-array&gt; &lt;/resources&gt; </code></pre> <p>(Be aware that the prefColorVal items should ref to the value you want the radio button to have. The values shown here are random.)</p> <p>In your preference.xml, add something like this:</p> <pre><code>&lt;ListPreference android:dialogTitle="Choose color" android:entries="@array/prefColor" android:entryValues="@array/prefColorVal" android:key="bat_below_15" android:negativeButtonText="Cancel" android:positiveButtonText="Save" android:summary="Choose color when below 15" android:title="Color when below 15" /&gt; </code></pre> <p>If you don't know how to get or use these values, here are some pointers, but you should google this stuff:</p> <pre><code>preferences = PreferenceManager.getDefaultSharedPreferences(ctx); </code></pre> <p>and use this to get the value:</p> <pre><code> preferences.getString("bat_below_15", Blue)); </code></pre> <p>Hope it helps. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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