So im trying to create a login page for my app and i'm implementing it on Android Studio but it receives an error saying cant not resolve symbol in setContentView. I have been cracking my head up for several hours but i still cant figure what wrong with it. setContentView(R.layout.activity_main); right here at this line, it says activity_main cant not resolve as a variable even though i name my xml file is exactly the same with it. here is my code,
package com.example.tieulyphidep.treasurehunters;
import android.app.ActionBar;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.R;
public class login extends ActionBarActivity implements View.OnClickListener{
Button bLoggin,buttonSignup;
EditText EditTextUserName, EditTextPassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bLoggin = (Button) findViewById(R.id.buttonLogin);
buttonSignup = (Button) findViewById(R.id.buttonSignup);
EditTextUserName =(EditText) findViewById(R.id.EditTextUserName);
EditTextPassword =(EditText) findViewById(R.id.EditTextPassword);
buttonLogin.setOnClickListener(this);
buttonSignup.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch(v.getId()){
case R.id.buttonLogin:
break;
case R.id.buttonSignup:
startActivity(new Intent(this, register.class));
break;
}
}
}