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

后端 未结 5 1294
悲哀的现实
悲哀的现实 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:35

    Use the following to change the softInputMode for an Activity.

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

    Use the following to change the softInput type for an EditText.

    mEditText.setImeOptions(EditorInfo.IME_ACTION_DONE);
    

    Thanks to @Eliezer for correction

提交回复
热议问题