I want to use a spinner to set a variable to an url. Every thing went well, till the R.java was build. I got 2 error:
duplicate R.string.http_
and
Syntax error, insert “;” to complete FieldDeclaration
So now my question is how to fix this error, while I can’t change the R.java file?
Here’s my code.
The R.java file:
public static final class string {
public static final int Mijngroep=0x7f050001;
public static final int app_name=0x7f050000;
public static final int http_//www_admiraalkruys_nl/nieuws_htm=0x7f050002;
public static final int http_//www_alexandergroep_nl/=0x7f050004;
public static final int http_//www_anthonievandiemenstam_nl/=0x7f050005;
public static final int http_//www_scoutingbeverwijk_nl/=0x7f050003;
And the strings.xml file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Groep kiezer</string>
<string name="Mijngroep">Selecteer jouw groep</string>
<string name="http://www.admiraalkruys.nl/nieuws.htm">Admiraal kruysgroep</string>
<string name="http://www.scoutingbeverwijk.nl/">Admiraal van Kinsbergen</string>
<string name="http://www.alexandergroep.nl/">Alexandergroep</string>
<string name="http://www.anthonievandiemenstam.nl/">Anthonie van diemenstam</string>
</resources>
You need to change your string names, if you use two successive slashes it will be interpreted as a java comment (
//) in the R.java file.EDIT :
In fact you should remove every special character because they are invalid characters in java for a variable name. For example you can remove the
http://part, and replace the special chars with underscores :