I have two EditText, how can I set the cursor in the right EditText
EditText emailE = (EditText) findViewById(R.id.editTextEmailLogin);
EditText passwordE = (EditText)findViewById(R.id.editTextPasswordLogin);
String email = emailE.getText().toString().trim();
String password = passwordE.getText().toString().trim();
if the user pressing Singin and the email EditText is empty, set the cursor in the email EditText. and the same for password EditText
if (TextUtils.isEmpty(email)){
Toast.makeText(this, getResources()"email is empty", Toast.LENGTH_SHORT).show();
//set cursor in Email editText
emailE.setSelection(0);
return;
}
if(TextUtils.isEmpty(password)){
Toast.makeText(this,"password is empty", Toast.LENGTH_SHORT).show();
//set cursor in Password editText
passwordE.setSelection(0);
return;
}