Q:

How to disable typing into EditText once its visibilty is set to Gone

I am writing an application on Android and I have these bunch of buttons; when you click on them the input panel (EditText) appears if it is not already visible otherwise it disappears.  
The problem is that the user can still type into the EditText even after it's disappeared.  I've attached two pictures to show what I mean.  

I tried .setEnabled(false) - didn't work. 
I tried .setFocusable(false) - didn't work. 
I tried both together - didn't work. 

A:

You can try hide soft keyboard before setting visibility. 
InputMethodManager imm = (InputMethodManager) YourActivity.this.getSystemService(Context. INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editView.getWindowToken(), 0);

