I am developing an Android App in which user needs to Register his account via his phone number. Now when the user have entered his number in the EditText View, he needs to press the Submit button to create his account, this submit button is present just below the EditText View.
As of now, after entering the number, when the user presses "Enter" key of his cellphone's keyboard, he is taken to next line of the EditText View, but, I want that when the user presses the Enter button, his account should be created. So, basically, I would want the Enter button to function exactly the way my Submit button is functioning.
Any help or guidance in this regard would be highly appreciated.
Code for my submit button:
final ImageButton bSubmit= (ImageButton) findViewById(R.id.bSubmit);
bSubmit.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
EditText eMobileNo = (EditText) findViewById(R.id.eMobileNo);
mobile = eMobileNo.getText().toString().replaceAll("[^\\d]", "");;
Log.i("MOBILE","MOBILE: "+mobile);
Toast.makeText(RegisterMe.this,"Your account has been successfully created",Toast.LENGTH_SHORT).show();
postData();
ConfirmToken();
finish();
}});