开发者

XML Code Not Working

I am a beginner at coding Android Apps. Here is my XML code under arrays.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <array name="difficulty">
        <item>"@string/easy_label"</item>
        <item>"@string/medium_label"</item>
        <item>"@string/hard_label"</item>
    </array>
</resources&开发者_JS百科gt;

"@string/easy_label" and the other labels are not highlighted a color. I'm assuming my program won't run because there is a problem here. Does anyone know how I can re-adjust this to make my Android program work?

On a side note: I have easy_label, medium_label, and hard_label all declared in strings.xml, so I don't think the reference to strings.xml is the problem.


What if you do it without double quotes:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <array name="difficulty">
        <item>@string/easy_label</item>
        <item>@string/medium_label</item>
        <item>@string/hard_label</item>
    </array>
</resources>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜