how do you get it so that edit text only accepts text if the user had puttet a K in to start with like
- KV1096
- K0024
In android, there is a listener for text change:
EditText mEditText = (EditText) findViewById(R.id.my_edit_text); //now you can add the listener here: mEditText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // here get the value entered by user and get the character //at index 0; String value = "what the user has entered".charAt(0) //now use an if statement here to see if it is your required value (K); if not, set EditText to disabled - not active; } @Override public void afterTextChanged(Editable s) { } }); I hope this helps you get started!