I have an editText that I want to fill out automatically with information from other controls on the form and at the same time allow it to change its contents, not encouraging the user from doing this.
So, I set this control to be defocusable, so when you press actionNext, it moves on to the next control. However, if you click on the edit text, I want to allow the user to modify its contents.
This is what I did:
mNameEditText.setFocusable(false); mNameEditText.setFocusableInTouchMode(false); mNameEditText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mNameEditText.setFocusableInTouchMode(true); mNameEditText.requestFocusFromTouch(); mNameEditText.setFocusable(true); } });
However, this behaves very strangely, as a result, when you click, you can edit, but suddenly the next control (AutoCompleteTextView) no longer focuses! Actually, it seems that the main focus remains in the editing text and at the same time goes to the autocompletetextview file, for example:

How can i fix this?
android
Michelreap
source share