Syntax error on token "QUOTE", VariableDeclaratorId expected after this token

Posted by user356812 on Stack Overflow See other posts from Stack Overflow or by user356812
Published on 2010-06-02T19:24:18Z Indexed on 2010/06/02 23:04 UTC
Read the original article Hit count: 898

Filed under:

I've posted a bigger chunk of the code below. You can see that initially QUOTE was procedural- coded in place. I'm trying to learn how to use declarative design so I want to do the same thing but by using resources. It seems like I need to access the string.xml thru the @R.id tag and identify QUOTE with that string value. But I don't know enough to negotiate this. Any tips? Thanks!

public class circle extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new GraphicsView(this)); }

static public class GraphicsView extends View {

  //private static final String QUOTE = "Happy Birthday to David.";

   private final String QUOTE = getString(R.string.quote);

..... @Override protected void onDraw(Canvas canvas) { // Drawing commands go here

     canvas.drawPath(circle, cPaint);
     canvas.drawTextOnPath(QUOTE, circle, 0, 20, tPaint);

© Stack Overflow or respective owner

Related posts about android