我知道他们有100个关于这个的帖子,不知何故它不适合我。 我得到了一个EditText,当我“触摸”那个盒子时,键盘必须出现。如何在edittext集中时显示软键盘
这一切我已经试过:
public void onClick(View v) {
EditText Edit_perceel_nr2 = (EditText)findViewById(R.id.Perceel_nr2);;
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(Edit_perceel_nr2.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
和
public void onClick(View v) {
EditText Edit_perceel_nr2 = (EditText)findViewById(R.id.Perceel_nr2);;
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(Edit_perceel_nr2.getWindowToken(), 0);
和
public void onClick(View v) {
EditText Edit_perceel_nr2 = (EditText)findViewById(R.id.Perceel_nr2);;
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(Edit_perceel_nr2, 0);
和
public void onClick(View v) {
EditText Edit_perceel_nr2 = (EditText)findViewById(R.id.Perceel_nr2);;
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(Edit_perceel_nr2, InputMethodManager.SHOW_IMPLICIT);
我甚至试图在清单中加入:
android:windowSoftInputMode="stateAlwaysVisible"
但我无法让它工作。 也许我忘了一些东西,但我现在没有想法。 有人有更多的想法或解决方案?
这是我的EditText:
<EditText
android:id="@+id/Perceel_nr2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:text="text">
</EditText>
据我知道你并不需要做任何事情来显示键盘。只需添加您的EditText并且不要为它设置onClick! – caiocpricci2 2012-02-28 09:12:39
哦,没有onClick是一个按钮,当我点击一个按钮,然后他必须做一些行动,这就是其中之一。 – Bigflow 2012-02-28 09:15:42
你是如何创建你的编辑文本? – caiocpricci2 2012-02-28 09:16:35