Vote Up 0 Vote Down

why did Eclipse IDE give me an error on "}"

This is a very easy code... But why did Eclipse IDE give me an error on "}" ???

alt text

This is all what I imprt into my project:
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.EditText;
import android.view.View;
import android.view.View.OnClickListener;
flag

Answers


Vote Up 0 Vote Down
Because u have four starting braces {.. but only three closing braces.. }
flag | link |
Vote Up 0 Vote Down
put }); where crossmark is there .
flag | link |
Vote Up 0 Vote Down
on the setOnClickListener event, you had lost 1 }, so the complier give error.
fix it:

 btn.setOnClickListenner ( new onClickListener () {
....
});
flag | link |

Your Answer

Login before answering

Login with facebook