Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get android:windowSoftInputMode attribute programmatically on Android

I am aware that the android:windowSoftInputMode manifest attribute can be set programmatically using the following method:

getWindow().setSoftInputMode(
       WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

Is there any way to get this value programmatically? I do not see a corresponding getter method.

like image 353
Dean Wild Avatar asked Apr 29 '16 10:04

Dean Wild


1 Answers

Found the solution, there is no 'convenience' get method but you can easily interrogate the window attributes manually:

int mode = getActivity().getWindow().getAttributes().softInputMode;
like image 193
Dean Wild Avatar answered Nov 15 '22 03:11

Dean Wild