Sorry about the vague description, i didn’t know how to explain it.
I’m creating a thread within my Android/Java app, the code is simple enough but it keeps giving off a strange error?
final Thread buttonPress = new Thread(){ //X
try {
findViewById(R.id.button1).setBackgroundResource(R.drawable.button1_down);
wait(500);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
findViewById(R.id.button1).setBackgroundResource(R.drawable.button1);
}
}; //XX
Besides where i marked /X i get the error message
“Multiple markers at this line
– Syntax error, insert “}” to complete ClassBody
– Syntax error, insert “;” to complete LocalVariableDeclarationStatement”
And at the end of thread, besides the “//XX” i get the error message,
“Syntax error on token “}”, delete this token”
You want something like
i.e. your missing a method declaration in your anonymous Thread class.