I recently started learning about developing in android and now I’m getting an error I can’t seem to fix. This is the code that won’t compile because of the Syntax error, insert “enum Identifier” to complete EnumHeaderName error. I suppose it is something trivial, but I can’t find it. Thanks for your help
Edit: Here is the complete code.
Don’t get confused about the functions of the methods, I try different things in this project, so they are not connected to each other.
public class MainActivity extends Activity {
boolean running = false;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
public void findRoot(View view){
EditText ed = (EditText)findViewById(R.id.editText1);
double base = Double.parseDouble(ed.getText().toString());
double res = Math.sqrt(base);
TextView t = (TextView)findViewById(R.id.resultText);
t.setText(getString(R.string.result_caption) + Double.toString(res));
}
int counter = 0;
final Handler mHandler = new Handler();
final Runnable mUpdateView = new Runnable(){
public void run(){
updateStopWatchView();
}
};
protected void startStopWatch(){
Thread t = new Thread(){
public void run(){
counter++;
mHandler.post(mUpdateView);
}
};
t.start();
}
public void updateStopWatchView(){
//
}
}
Edit: Please upgrade to ADT 20.0.1. The bug has been fixed.
Just a shot in the dark: Does the Eclipse problems view show “Android Lint Problem” in the Type column of this bug? If so, please open the view Lint warnings and hit the “Remove all” button. Lint sometimes gets confused and takes over Java errors which then stay active even after the bug has been fixed.