list - Symbol '%' causes crash when used in android:summary tag -


i have declaration of preference list in preference.xml file:

<listpreference         android:key="pref_reflected_calibration"         android:title="calibration constant"         android:summary="select 18% dslr (default), 12.5% sekonics"         android:entries="@array/reflected_calibration_entries"         android:entryvalues="@array/reflected_calibration_values"         android:defaultvalue="18"/> 

it causes crash error: "java.util.illegalformatconversionexception: %f can't format java.lang.string arguments"

when remove '%' symbol android:summary tag, works ok. replacing '%' symbol unicode equivalent doesn't help. couldn't find explanation in documentation, ask question here

in java % symbol precedes format specifier, causes error. escaping % symbols % should solve issue:

android:summary="select 18%% dslr (default), 12.5%% sekonics" 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -