:: ANDROID STUDIO / 안드로이드 스튜디오 ::


multiple substitutions specified in non-positional format did you mean to add the formatted= false



안드로이드 스튜디오의 string.xml에서 간혹 위와 같은 오류가 발생할 때가 있습니다. 아래와 같이 변수를 사용하는 string을 사용할 때 에러가 나는데 해결 방법은 의외로 매우 간단합니다.


<string name="apples_summary" >The cost of %d apples is %.2f</string>


string name 뒤에 formatted="false"를 추가해주면 에러가 해결됩니다.

<string name="apples_summary" formatted="false">The cost of %d apples is %.2f</string>



Posted by Bloney
,