Here I'm trying to create Login email and password functions.
the app works fine for this code of yours below:
public class StartActivity extends AppCompatActivity {
private Button mRegButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);
mRegButton = (Button) findViewById(R.id.start_reg_btn);
mRegButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent regIntent = new Intent(StartActivity.this, RegisterActivity.class);
startActivity(regIntent);
}
});
}
}
But when i add the code below to make the login button work, the app crashes:
public class StartActivity extends AppCompatActivity {
private Button mRegButton;
private Button mLoginButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);
mRegButton = (Button) findViewById(R.id.start_reg_btn);
mRegButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent regIntent = new Intent(StartActivity.this, RegisterActivity.class);
startActivity(regIntent);
}
});
mLoginButton = (Button) findViewById(R.id.login_btn);
mLoginButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent loginIntent = new Intent(StartActivity.this, Login.class);
startActivity(loginIntent);
}
});
}
}
please help. i have been wasting almost 4 hour trying to figure what is happening, but failed to get the problem solved.