0
在我的應用程序中有一個選項來從編輯文本中選擇文本。內容將自動設置爲編輯文本。因此,我把代碼隱藏鍵盤,但當我試圖通過選擇默認菜單來選擇文本時,鍵盤來foreground.i試圖阻止它通過清單文件,但它也不工作在我的device.one事情,我注意到它在一些其他設備工作正常所以這是怎麼回事?請幫助我...如何在編輯文本中選擇默認菜單時隱藏軟鍵盤?
用於隱藏所述軟鍵盤代碼如下
1)
InputMethodManager imm=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(Edittext.getWindowToken(),0);
或
XML
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:editable="false">
</EditText>
2)用來隱藏在特定的活動的softkeyboard(清單文件)碼
<activity android:name=".selecttext" android:label="@string/app_name" android:windowSoftInputMode="stateHidden"></activity>
或
<activity android:name=".selecttext" android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden"></activity>