Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

Possible bug with shared preferences?

$
0
0
So I have an app that uses various currency symbols and you can select whichever you like via the standard Android preference view and I noticed that if a currency uses the same symbol e.g. USD, AUD, SGD which all use the $ it will default to the last item in the list. For instance, from the list below if I choose USD or AUD it will default to SGD when I click again but if I choose say ZAR, MYR, EUR, or GBP it will stick to that one as the value doesn't repeat in the array. If I have just one entry that has the $ symbol all is fine. Anyone else notice this or am I missing something here?

<string-array name="currency">
<item name="eur">EUR</item>
<item name="gbp">GBP</item>
<item name="jpy">JPY</item>
<item name="usd">USD</item>
<item name="zar">ZAR</item>
<item name="myr">MYR</item>
<item name="cny">CNY</item>
<item name="aud">AUD</item>
<item name="sgd">SGD</item>
</string-array>

<string-array name="currencyValues">
<item name="eur">€</item>
<item name="gbp">£</item>
<item name="jpy">¥</item>
<item name="usd">$</item>
<item name="zar">R</item>
<item name="myr">MR</item>
<item name="cny">¥</item>
<item name="aud">$</item>
<item name="sgd">$</item>
</string-array>

Viewing all articles
Browse latest Browse all 3614

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>