android-softkeyboard

Restricting Android NumberPicker to Numeric Keyboard for Numeric Input (not Alpha keyboard)

末鹿安然 提交于 2019-11-28 04:19:46
问题 Is there a way to suggest or restrict keyboard input when selecting a NumberPicker so only the number controls are shown when entering values, similar to how you can use android:inputType="number" with a EditText? I have a series of values, from 0.0 to 100.0 in 0.1 increments that I'd like to be able to use a NumberPicker to select in Android 4.3. In order to have the numbers selectable, I've created an array of strings which corresponds to these values, as shown below: NumberPicker np =

WebView doesn't scroll when keyboard opened

社会主义新天地 提交于 2019-11-28 04:12:31
问题 I have a WebView that contains an input form. When the user selects the first input the keyboard appears and will scroll the WebView so that the input is uncovered. My problem is in < API 19 when tapping on the next partially obscured input the WebView doesn't scroll. If I were to close the keyboard and then select the input it would scroll correctly. I've read a lot about if the Activity is FullScreen then it won't work but my app isn't. Manifest: <?xml version="1.0" encoding="utf-8"?>

Auto Collapse ActionBar SearchView on Soft Keyboard close

送分小仙女□ 提交于 2019-11-28 04:02:46
I am currently using an ActionBar menu item to display a SearchView in the action bar. When the search menu item is expanded the soft keyboard is displayed which is what I want. Now, when the user presses the back button to close the soft keyboard, I would also like to collapse the SearchView in the action bar. I have tried implementing the following listeners OnKeyListener and OnFocusChangeListener on the MenuItem and the ActionView. I have also tried using OnBackPressed() in the Activity. None of the above detect when the back button is used to close the soft keyboard. Any ideas? I have

How to draw view on top of soft keyboard like WhatsApp?

≯℡__Kan透↙ 提交于 2019-11-28 03:57:31
I want to know how it's possible to add View on top of Keyboard like WhatsApp and Hangout. In chat screen, they insert emoticons view on top of the opened soft keyboard. Does anyone know how to achieve this behavior? Well, I have created a sample keyboard for chatting here ... Here, I use popup window for showing popup window and height of popup is calculated dynamically by height of keyboard // Initially defining default height of keyboard which is equal to 230 dip final float popUpheight = getResources().getDimension( R.dimen.keyboard_height); changeKeyboardHeight((int) popUpheight); //

How to remove auto focus/keyboard popup of a field when the screen shows up?

為{幸葍}努か 提交于 2019-11-28 03:31:19
I have a screen where the first field is an EditText, and it gains the focus at startup, also popups the numeric input type, which is very annoying How can I make sure that when the activity is started the focus is not gained, and/or the input panel is not raised? Mitul Nakum InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0); or set activity property in manifest file as below in the application tag android:windowSoftInputMode="stateHidden" go to your application manifest file, and write

edittext.settext() changes the keyboard type to default [ from ?123 to ABC]

妖精的绣舞 提交于 2019-11-28 03:08:48
问题 I have following code for my edittext formatting, since it can take any input I am not setting any input type: if (cardNumberEditText != null) { cardNumberEditText.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { int currSel = cardNumberEditText.getSelectionStart(); cardNumberEditText.removeTextChangedListener(textWatcher); . . cardNumberEditText.setText(formattedNumber); . . cardNumberEditText.setSelection

Need number only soft keyboard?

三世轮回 提交于 2019-11-28 02:57:59
问题 Hi I need a soft keyboard with only numeric values 0 to 9 and Enter key. Shouldn't show anything other than these like . , ( ) etc... I tried several options as suggested here but nothings seems to work for me. setRawInputType(Configuration.KEYBOARD_QWERTY) setRawInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED) setRawInputType(InputType.TYPE_CLASS_NUMBER) setRawInputType(InputType.TYPE_CLASS_PHONE) I always have the extra characters show up on the keyboard like:

SoftKeyboard does not display for a newly displayed Fragment

霸气de小男生 提交于 2019-11-28 02:50:48
问题 I have a FragmentActivity that initially displays a fragment with a few buttons on it. When you click one of the buttons, the FragmentActivity displays a new fragment with some editText fields. I can't seem to get the soft input keyboard to display when my new fragment with the editText fields is displayed. Using the windowSoftInput mode on the manifest is out as that displays the keyboard right away. android:windowSoftInputMode="stateUnchanged" I have tried using getWindow().setSoftInputMode

Keep soft keyboard open when enter key is pressed

◇◆丶佛笑我妖孽 提交于 2019-11-28 00:08:01
Well, I'm trying to prevent the soft keyboard from closing when the user press the "ok" button after editing a text field. Actually, what i'm trying to achieve is : when "ok" button is pressed, the field is parsed and if valid, it starts another activity. That is easy enough. But, when the field is not valid, I want the soft keyboard to stay open. And that's... a hell more complicated. If anyone know how to achieve such a thing... Thanks in advance. EDIT : what I mean by the OK button is the OK button from the soft keyboard. Attach OnEditorActionListener to your text field and return true from

How to show Android keyboard with symbols mode by default?

断了今生、忘了曾经 提交于 2019-11-27 22:14:34
I have a EditText component, and, of course, if you click on it, the Android keypad is shown, allowing the user to input text. As far as I know, all Android software keyboards have (at least) a letter mode ( ABC ) and a symbols mode ( ?123 ). Their default view is the letter mode. Now when the keypad is shown when the EditText component is clicked, I want the symbols mode to be shown by default. The user will still be able to switch to the letter mode. Is there a way to achieve that? If yes, how? Vikram I'm posting this because I don't think any of the answers actually address the question.