How can I get my Override to work without throwing an error?

wawVewpiose

New Member
I am trying to implement a dialog box that pops up when a button is pressed. The contents of the dialog will vary depending on what button is pressed. I can get the dialog to pop up with the contents and buttons, only the buttons are unresponsive. I have tried the following code to try and resolve the problem.\[code\]public void showDialog(){ final Dialog dialog= new Dialog(context); dialog.setContentView(R.layout.dialog_info); infoView=(EditText) dialog.findViewById(R.id.infoView); infoView.setFocusable(false); infoView.setText(""); dialog.setTitle(aList.get(count).toTitle()); infoView.append(aList.get(count).toDescription()); Button back=(Button)findViewById(R.id.back); Button reminder=(Button)findViewById(R.id.reminder); Log.e(TAG,"Testing click 1.5"); back.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Log.e(TAG,"Testing click 2"); dialog.dismiss(); } }); dialog.show();}\[/code\]From examples I have looked at the \[code\]@Override\[/code\] statement has to be there but for some reason an error shows saying \[code\]"multiple markers at this line""implements android.view.View.OnClickListener.OnClick""The method onClick(view) of type new View.OnClickListener(){} must override a superclass method"\[/code\]Surely the \[code\]@Override\[/code\] statement overrides the superclass method? but when I take out the \[code\]@Override\[/code\] the error message disappears! What is this madness???
 
Back
Top