Is there any way to change android:windowSoftInputMode value from java class?

后端 未结 5 1281
悲哀的现实
悲哀的现实 2020-12-02 12:00

I want to act my tabs to have different windowSoftInputMode properties for each tab. How to access this property from java class when all handling of your tab

5条回答
  •  情深已故
    2020-12-02 12:31

    You can use the following code programmatically

    android.view.inputmethod.InputMethodManager imm = (android.view.inputmethod.InputMethodManager) context
                    .getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
    

    Thanks Deepak

提交回复
热议问题