I just created a new android project and prepared the basic structure for it. Eclipse is telling me that it couldn't resolve any strings, even the standard "hello"
or "app_name"
strings :O Restarting the IDE didn't help. Any suggestions? A screenshot can be found here
A string resource provides text strings for your application with optional text styling and formatting. There are three types of resources that can provide your application with strings: String. XML resource that provides a single string.
String. xml file contains all the strings which will be used frequently in Android project. String. xml file present in the values folder which is sub folder of res folder in project structure.In Android Studio, we have many Views such as TextView,Button,EditText,CheckBox,RadioButton etc.
"cannot be resolved to a type" means that the compiler has decided that, according to the syntax of the language, what it found at this place in the code has to be type, which means either a class, an interface, or a primitive tpye, but cannot find the definition of any type with that name.
The XML resource files containing localized strings are placed in subfolders of the project's res folder. Android uses a special folder-naming scheme to automatically choose the correct localized resources—for example, the folder values-fr would contain a strings.
I noticed that in your project, there is no values
resource folder. The resource in the folder with the suffix of -de
,-en
will be applied when the language on the device is German, UK, but the default folder should not be deleted. Try to add the values
folder and corresponding string.xml
to the project.
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