Error in strings.xml file in Android
post your complete string. Though, my guess is there is an apostrophe (') character in your string. replace it with (\') and it will fix the issue. for example,
//strings.xml
<string name="terms">
Hey Mr. Android, are you stuck? Here, I\'ll clear a path for you.
</string>
Ref:
http://www.mrexcel.com/forum/showthread.php?t=195353
https://code.google.com/archive/p/replicaisland/issues/48
Error when converting strings to strings.xml, android studio
UnknownFormatConversionException
means it has not been able to convert your argument variable, passed to getString(), to the specified format (in your XML file).
You should use d
to format integer numbers.
Strings.xml gives a translation error whenever I try to add a new string resource
I did invalidate cache & restart, which solved my issue.
android error in String.xml
It is an ignorable warning because of missing translations.
Navigate to the preferences (Window -> Preferences -> Android -> Lint Error Checking
) and set "Missing Translation
" to WARNING or IGNORE.
You can try as per suggestion given here (Not verified)
<string name="title_activity_data" translatable="false">Data</string>
getting info from string.xml in android studio does not work
Seems your code should work if it is not working then please try like this
Trick 1
String url = getResources().getString(R.string.url2);
Trick 2
this.getString(R.string.url2)
Hope it will help you.
Using ' in string.xml file
Replace your line
<string name="app_name">My \'App</string>
with
<string name="app_name">My 'App</string>
Why can't I using '&' in android resource strings.xml file in android studio?
Use &
instead of just &
UPD:
Answer to "Why can't you use &" is: it is by design: http://www.w3.org/TR/xml/#charsets
The ampersand character (&) and the left angle bracket (<) MUST NOT
appear in their literal form, except when used as markup delimiters,
or within a comment, a processing instruction, or a CDATA section. If
they are needed elsewhere, they MUST be escaped using either numeric
character references or the strings " & " and " < "
respectively. The right angle bracket (>) may be represented using the
string " > ", and MUST, for compatibility, be escaped using either
" > " or a character reference when it appears in the string " ]]>
" in content, when that string is not marking the end of a CDATA
section.
Related Topics
Display a Part of the Webpage on the Webview Android
How to Use Mkfifo Using Android's Ndk
Notifydatasetchanged Not Working on Recyclerview
How to Find the Android Version Name Programmatically
Android Material Chip Component Crashing App. Unable to Inflate Xml
Java.Lang.Noclassdeffounderror: Failed Resolution Of: Landroid/Support/V4/Os/Buildcompat
Android - Navigation View Item Menu Background Color
Android - Nestedscrollview Which Contains Expandablelistview Doesn't Scroll When Expanded
Transfer Data from One Activity to Another Activity Using Intents
How to Update UI from Asynctask
Android Opening a File with Action_Get_Content Results into Different Uri'S
Force a Camera to Always Open in Portrait Mode in Android