android-keypad

Open a numeric keyboard without forcing the EditText to be numeric only

我的梦境 提交于 2019-12-19 06:32:11
问题 I've come across this while doing work on creating my own Keyboard but can't for the life of me remember where I ran across it. I want top open the Numeric keyboard. However, I want my EditText to only accept an IP address. Adding a filter to my EditText wasn't too hard thanks to this answer. However, now I want to make the Numeric keyboard to open rather than the standard text keyboard. Unfortunately search results are saturated with the same "How do you limit EditText to numeric input?"

Open a numeric keyboard without forcing the EditText to be numeric only

偶尔善良 提交于 2019-12-19 06:32:06
问题 I've come across this while doing work on creating my own Keyboard but can't for the life of me remember where I ran across it. I want top open the Numeric keyboard. However, I want my EditText to only accept an IP address. Adding a filter to my EditText wasn't too hard thanks to this answer. However, now I want to make the Numeric keyboard to open rather than the standard text keyboard. Unfortunately search results are saturated with the same "How do you limit EditText to numeric input?"

Hide keypad in android while touching outside Edit Text Area

有些话、适合烂在心里 提交于 2019-12-18 21:12:11
问题 I know that the code for dismiss tyhe keypad in android is InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0); Can anyone suggest me a method to hide the keypad if we touch the area outside the text area other than the keypad in the screen. 回答1: Code to dismiss Softkeyboard is below: public static void hideSoftKeyboard(Activity activity) { InputMethodManager inputMethodManager =

android making layout scrollable when soft keyboard open, but not shifting it upwards

北城以北 提交于 2019-12-18 05:38:23
问题 This is my screen, with one button hidden behind the keyboard. I want exactly like this, but scrollable. - Whenever, the keyboard gets opened, I want to make look it the same as in image. But, instead to make it scrollable, so that the user can scroll to view the bottom part of the screen (including button), even when the keyboard is open. I tried - android:windowSoftInputMode="adjustResize" but, this shifts the bottom part upwards, whenever keyboard is opened. as in this image - I don't want

android making layout scrollable when soft keyboard open, but not shifting it upwards

筅森魡賤 提交于 2019-12-18 05:38:00
问题 This is my screen, with one button hidden behind the keyboard. I want exactly like this, but scrollable. - Whenever, the keyboard gets opened, I want to make look it the same as in image. But, instead to make it scrollable, so that the user can scroll to view the bottom part of the screen (including button), even when the keyboard is open. I tried - android:windowSoftInputMode="adjustResize" but, this shifts the bottom part upwards, whenever keyboard is opened. as in this image - I don't want

getting list of languages supported by android keyboard

依然范特西╮ 提交于 2019-12-18 05:02:20
问题 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 ?. 回答1: 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) ->

Get Cursor Position in Android in Edit Text?

北战南征 提交于 2019-12-17 07:11:15
问题 I am using a custom EditText View. I have overridden the OnKeyUp event and am able to capture the Enter Key press. Now my requirement is, when the user has entered a text "Hi. How are you?" and then keeps the cursor after the word "are" and press enter, I need to get the cursor location so that i can extract the text after the cursor at the moment the Enter Key was pressed. Please let me know how to do this. Thank you for your time and help. 回答1: You can get the Cursor position using the

android:windowSoftInputMode=“adjustResize” doesn't make any difference?

情到浓时终转凉″ 提交于 2019-12-17 04:54:27
问题 I have a faux dialog which uses this layout: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/containerPageConatiner"> <FrameLayout android:id="@+id/dialogHolder" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="15dp" android:layout_gravity="center" android:background="@drawable/panel_picture_frame_bg

Android EditText : How to avoid user enter smileys?

本小妞迷上赌 提交于 2019-12-14 04:25:15
问题 I would like to avoid to the user to put a smiley with the keyboard into an EditText . Is it possible ? 回答1: You can define your input type and only accept letters or change your keyboard type: https://developer.android.com/training/keyboard-input/style.html Or you can only accept some specific digits: How to create EditText accepts Alphabets only in android? 回答2: Editing answer from here. This will allow only ASCII characters to be entered in EditText. edittext.setFilters(new InputFilter[] {

How to disable the dialpad soft keyboard in android?

痴心易碎 提交于 2019-12-13 08:30:30
问题 I am working on the Phone app in tablet mode.I want to disable the soft keypad wen we click on the edit text.Can any one please help me.. Thanks in advance. 回答1: Use this for hide InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(edit.getWindowToken(), 0); Use this for show InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager