I'm using Android Lint for checking my translated strings. I have a string
<string name='status_bar_text_remaining_capacity'>%d%% remaining</string>
Lint reports this
res/values/strings.xml:91: Error: Format string 'status_bar_text_remaining_capacity' is not a valid format string so it should not be passed to String.format [StringFormatInvalid]
<string name='status_bar_text_remaining_capacity'>%d%% remaining</string>
As far as I understand documentation for String.format()
then this is valid string. Do you have any idea what is wrong?
Run the lint tool on your module by right-clicking on your module folder or file in the Project View and selecting Analyze > Inspect Code. This displays the lint inspection results with a list of issues that lint detected in your module.
The lint tool helps find poorly structured code that can impact the reliability and efficiency of your Android apps and make your code harder to maintain. For example, if your XML resource files contain unused namespaces, this takes up space and incurs unnecessary processing.
To suppress a lint warning with an annotation, add a @SuppressLint("id") annotation on the class, method or variable declaration closest to the warning instance you want to disable.
This was a bug in lint which was fixed recently; https://android-review.googlesource.com/#/c/46741/1
The fix is in ADT 21.0.1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With