I have a button "show" and when the button is clicked , the edit text box must not be editable and when I click next, I must give back the focus to edit text box. I tried the below code
showans.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editText.setFocusable(false);
}
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editText.setFocusable(true);
editText.setClickable(true);
}
}
I tried changing values between setFocusable and setClickable but nothing helped. When I click the showans button for the first time, the edit box loses focus and its not clickable though I set the value to true when I click the "next" button and all these buttons .All these text boxes and buttons are dynamically generated.Any help would be great !! Thanks