android softkeyboard showSoftInput vs toggleSoftInput
showSoftInput()
nie pokazuje mi klawiatury, aletoggleSoftInput()
robi. Widziałem inny post, który mówił o wyłączeniu twardej klawiatury podczas korzystania z emulatora, ale nie używam emulatora. Ładuję mój APK na rzeczywistym urządzeniu bez twardej klawiatury. Czy obie metody nie powinny działać? Dlaczego nieshowSoftInput()
praca? Chciałbym wyraźnie powiązać klawiaturę z konkretnym polem tekstowym.
Nie działa:
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
editText.setText("textchange"); //i see the text field update
imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED);
Prace:
InputMethodManager imm = (InputMethodManager) getDelegate().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);