Question: I'm trying to make a login screen where if username is admin and password is admin, then it directs me to a new screen. When I try run it, it shows up with these errors

> 
> Error:(35, 10) error: ')' expected
> 
> 
> Error:(37, 2) error: reached end of file while parsing
> 
> 
> Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
> 
> 
> 

My code is as follows

```
public class Login extends Activity {

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);

    Button login=(Button)findViewById(R.id.button2);
    EditText username = (EditText)findViewById(R.id.editText2);
    EditText password = (EditText)findViewById(R.id.editText3);

    login.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            if (username.getText().toString().equals("admin") && password.getText().toString().equals("admin")) {

                Intent i = new Intent(Login.this, MainActivity.class);
                startActivity(i);
            }
            else {

            }
        }
    }
}
}

```

Anyone know what I'm doing wrong?

Answer: 
Use this 

```
login.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        if (username.getText().toString().equals("admin") && password.getText().toString().equals("admin")) {

            Intent i = new Intent(Login.this, MainActivity.class);
            startActivity(i);
        }
        else {

        }
    }
});

```
You miss `);`

```
 public class Login extends Activity {
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);

    Button login=(Button)findViewById(R.id.button2);
    EditText username = (EditText)findViewById(R.id.editText2);
    EditText password = (EditText)findViewById(R.id.editText3);

    login.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            if (username.getText().toString().equals("admin") && password.getText().toString().equals("admin")) {

                Intent i = new Intent(Login.this, MainActivity.class);
                startActivity(i);
            }
            else {

            }
        }
    });
}
}

```