getResources () java android game code
<p>I have been trying to set color on my android game the code i am using is:</p>

<p>//Draw the board....    </p>

<pre><code>//Define colours for grid lines
    Paint hilite = new Paint();
    hilite.setColor(getResources().getColor(R.color.game_hilite));
    Paint light = new Paint();
    light.setColor(getResources().getColor(R.color.game_light));
    Paint dark = new Paint();
    dark.setColor(getResources().getColor(R.color.game_dark));``
</code></pre>

<p>i have set up the color in the color.xml code as:</p>

<pre><code>&lt;resources&gt;
  &lt;color name="game_background"&gt;#ffe6f0ff&lt;/color&gt;
    &lt;color name="game_hilite"&gt;#ffffffff&lt;/color&gt;
    &lt;color name="game_light"&gt;#64c6d4ef&lt;/color&gt;
    &lt;color name="game_dark"&gt;#6456648f&lt;/color&gt;
    &lt;color name="game_foreground"&gt;#ff000000&lt;/color&gt;
    &lt;color name="game_selected"&gt;#64ff8000&lt;/color&gt;
&lt;/resources&gt;`
</code></pre>

<p>just cant seem to see where is going wrong, the code in bold is where i seem to be getting the issues multi marker errors. </p>

<p>the full code section i have is:</p>

<pre><code>         @Override
        protected void onDraw(Canvas canvas) {
        //Draw the background...
        Paint background = new Paint();
        background.setColor(getResources()
                    .getColor(R.color.game_background));
        canvas.drawRect(0, 0, getWidth(), getHeight(), background);

        //Draw the board
        //Draw the selection
    }

    //Draw the board....
    //Define colours for grid lines
    Paint hilite = new Paint();
    hilite.setColor(getResources().getColor(R.color.game_hilite));
    Paint light = new Paint();
    light.setColor(getResources().getColor(R.color.game_light));
    Paint dark = new Paint();
    dark.setColor(getResources().getColor(R.color.game_dark));


    //Draw the minor grid lines
    Canvas canvas;
    for (int i = 0; i &lt;9; i++) {
        canvas.drawLine(0, i * height, getWidth(), i * height, light);
        canvas.drawLine(0, i * height + 1, getWidth(), i * height + 1, hilite);
        canvas.drawLine(i * width, 0, i * width, getHeight(), light);
        canvas.drawLine(i * width + 1, 0, i * width + 1, getHeight(), hilite);  
    }
    //Draw the major grid lines
    for (int i = 0; i &lt; 9; i++) {
        if (i % 3 != 0)
            continue;
        canvas.drawLine(0, i * height, getWidth(), i * height, dark);
        canvas.drawLine(0, i * height + 1, getWidth(), i * height + 1, hilite);
        canvas.drawLine(i * width, 0, i * width, getHeight(), dark);
        canvas.drawLine(i * width + 1, 0, i * width + 1, getHeight(), hilite);
    }
</code></pre>

<p>}</p>
