32

Possible Duplicate:
Android XML Percent Symbol

hi mate i have an array in file xml:

<string-array name="type_data_graph">
        <item>Veichle speed (Km/h)</item>
        <item>Engine Rpm (rpm)</item>
        <item>Barometric pressure (kPa absolute)</item>
        <item>Fuel pressure (kPa)</item>
        <item>Fuel Rail pressure of manifold vacuum (kPa)</item>
        <item>Fuel Rail pressure diesel/gasoline (kPa)</item>
        <item>MAF air flow rate (grams/sec)</item>
        <item>Intake MAP (kPa)</item>
         <item>Engine % torque (%) </item>       
......
    </string-array>

when commpile i get error on

     <item>Engine % torque (%) </item>       

the error is

Description Resource Path Location Type error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute? arrays.xml /DashboardDroid/res/values line 43 Android AAPT Problem

Description Resource Path Location Type error: Found tag where is expected arrays.xml /DashboardDroid/res/values line 43 Android AAPT Problem what means ??? i close all tag

Community
  • 1
  • 1
esoni
  • 1,362
  • 4
  • 24
  • 37
  • 7
    The `%` is a reserved character in XML like `<`, `>`, etc. Please read this question: [Android XML Percent Symbol](http://stackoverflow.com/questions/4414389/android-xml-percent-symbol) (Basically use `\%%` for each `%`.) – Sam Sep 26 '12 at 15:58
  • This error appears also when you use %s or %d more than once (as attempted to describe by the error message :) – Buddy Sep 27 '15 at 19:39

1 Answers1

91

instead of

 Engine % torque (%)

try using

Engine %% torque (%%)

if you need a % in your strings.xml file

or try checking the link here

or else simply try giving

 formatted="false" 

in your

<string-array> 

tag

G_S
  • 7,068
  • 2
  • 21
  • 51