android-softkeyboard

Android - adjust scrollview when keyboard is up for android 5.0 (lollipop)

拟墨画扇 提交于 2019-11-29 10:23:00
I have a problem on android lollipop, screen doesn't adjust size when the softkeyboard comes up. This is my manifest intro example from one of the activity i made: android:windowSoftInputMode="stateAlwaysHidden|adjustResize" Is there something new that is added and we have to take into account for android 5.0 ? The scrollview works fine on android < 5.0. the problem was that it didn't work with translucent status bar and i had to set android:fitsSystemWindows="true" in my main layout For the guy's who still have this issue even with android:fitsSystemWindows="true" in the ScrollView. I found

Need number only soft keyboard?

Deadly 提交于 2019-11-29 09:29:13
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: setRawInputType(Configuration.KEYBOARD_12KEY) shows a keyboard like this: Would appreciate any help. Thanks

SoftKeyboard does not display for a newly displayed Fragment

回眸只為那壹抹淺笑 提交于 2019-11-29 09:25:57
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(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE) to no avail. Here's how I display the new

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

廉价感情. 提交于 2019-11-29 09:22:35
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(currSel); cardNumberEditText.addTextChangedListener(textWatcher); } @Override public void beforeTextChanged

Listen for keyboard show or hide event in android [duplicate]

核能气质少年 提交于 2019-11-29 09:11:16
This question already has an answer here: How to capture the “virtual keyboard show/hide” event in Android? 15 answers I am trying to listen for events that occurs when the keyboard is shown or hidden. Is this possible in Android? I am not trying to figure out if the keyboard is shown or hidden when I start my activity, I would like to listen for events. duggu Try below code:- // from the link above @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // Checks whether a hardware keyboard is available if (newConfig.hardKeyboardHidden

How to stop Soft keyboard showing automatically when focus is changed (OnStart event)

╄→尐↘猪︶ㄣ 提交于 2019-11-29 09:04:45
I am developing for a tablet using Android 2.2. I have a form which I am using for new and editable instances. When editable, I want to stop the user from editing certain fields. I manage this in my onStart -event, setting the txt.setFocusableInTouchMode(false) . This forces the focus to the next focusable EditText in my form (which is great), but when running, the soft keyboard automatically appears for the EditText with the focus. Anybody know how to stop this? Here's the code (called in the onStart event): private void PopulateFields(){ TextView txtTitle = (TextView) this.findViewById(R.id

getting list of languages supported by android keyboard

天大地大妈咪最大 提交于 2019-11-29 07:10:01
I need to display the list of the all languages which are supported by android keyboard. Now I am using Locale.getAvailableLocales(); method but i am getting language and country constants. I need all language names only. Is it possible? and how ?. How about using Locale.getDisplayName(Locale) on each Locale you get with Locale.getAvailableLocales(); ? Returns this locale's language name, country name, and variant, localized to locale. new Locale("en").getDisplayName(Locale.US) -> English 来源: https://stackoverflow.com/questions/6579046/getting-list-of-languages-supported-by-android-keyboard

how to change key background of any key in Android soft keyboard

不问归期 提交于 2019-11-29 07:07:30
问题 I want to have some of my keys in the keyboard different from others. For example,like shift, delete, space key in below photo: According to the reference documents from google. We can change key's background by use " android:keybackground=@drawable/xxx " in " input.xml ", but it change background of all keys in keyboard. Although "android:keyicon" in qwerty.xml can have single key changed,but it only replace the label. Meanwhile, use " android:keyicon " , the image can not cover entire key ,

How disable softkeyboard in WebView

跟風遠走 提交于 2019-11-29 06:53:02
I need disable open softkeyboard in my WebView and in all edittexts in WebView (I do not access to thay because its is in WebView). I try use 'android:windowSoftInputMode="stateAlwaysHidden"' in my Manifest file, but keyboard popup on when I click in editable field. What is right solution for disable softkeyboard in WebView? EDIT: I find solution (thanks @g00dy in this post and @Kachi in post https://stackoverflow.com/a/9108219/1665964 ) for close keyboard after it open: public class ActivityBrowser extends Activity { private static WebView webviewHTML; private static View viewRootHTML;

Hiding the android keyboard for EditText

可紊 提交于 2019-11-29 05:47:54
Whenever I click in the EditText the Android keyboard popup window appears, but I don't want the keyboard to pop up. I want to permanently hide the android keyboard popup for my current application. How can I do this? Andrei Lupsa Setting the flag textIsSelectable to true disables the soft keyboard. You can set it in your xml layout like this: <EditText android:id="@+id/editText" ... android:textIsSelectable="true"/> Or programmatically, like this: EditText editText = (EditText) findViewById(R.id.editText); editText.setTextIsSelectable(true); The cursor will still be present, you'll be able to