In a custom ListView, there are two columns, one contains a TextView and the other a EditText component.To enter some preferences, as the user clicks on the EditText, the software keyboard comes in focus but focus from the EditText is lost. How I can do this?
Asked
Active
Viewed 1.0k times
2 Answers
4
For editText use method setFocusable(false). For textView use setFocusable(true).
Also write a listener on focus lost for both textView and editText:
textView.setOnFocusChangeListener(new OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
if(!hasFocus)
{
//do job here when EditText loses focus
}
}
});

Guillermo GutiƩrrez
- 17,273
- 17
- 89
- 116

macloving
- 1,227
- 1
- 18
- 22