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
- 16,514
- 16
- 85
- 113
macloving
- 1,157
- 1
- 17
- 22