有没有办法改变的android:从Java类windowSoftInputMode价值? [英] Is there any way to change android:windowSoftInputMode value from java class?

查看:144
本文介绍了有没有办法改变的android:从Java类windowSoftInputMode价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的行动标签有不同的 windowSoftInputMode 属性为每个标签。如何访问java类此属性,当你的标签的所有处理都从一个单一的活动呢?

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 is done from one single activity?

有没有办法从Java code访问此清单属性?

Is there any way to access this manifest property from java code?

推荐答案

使用下面的改变softInputMode一个活动。

Use the following to change the softInputMode for an Activity.

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

使用以下更改softInput类型一个EditText。

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

mEditText.setImeOptions(EditorInfo.IME_ACTION_DONE);

感谢@Eliezer整改

Thanks to @Eliezer for correction

这篇关于有没有办法改变的android:从Java类windowSoftInputMode价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆