<string name="app_name">WebView Z/I</string>
<string name="http://www.cherkaoui.info/Spikal"> Cherkaoui</string>
package com.firstest.android;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class id {
public static final int buttonUrl=0x7f050000;
public static final int webView1=0x7f050001;
}
public static final class layout {
public static final int main=0x7f030000;
public static final int webview=0x7f030001;
}
public static final class string {
public static final int app_name=0x7f040000;
**public static final int http_//www_cherkaoui_info/Spikal=0x7f040001;**
}
}
我在网上查了一下,我在string.xml上遇到了问题,但我不知道它是哪一个。
答案 0 :(得分:6)
您无法在标识符中使用/
- 所以:
http_//www_cherkaoui_info/Spikal=0x7f040001
不是有效的变量名称。更改XML以使用有效的标识符。
答案 1 :(得分:0)
string name属性必须是有效的java标识符你认为这个"http://www.cherkaoui.info/Spikal
“是一个有效的java标识符???
你可以这样做
<string name="http_www_cherkaoui_info_Spikal"> Cherkaoui</string>
然后你可以在代码中引用它
String str = getString(R.string.http_www_cherkaoui_info_Spikal);