android-softkeyboard

Android: EditText in Dialog doesn't pull up soft keyboard

大兔子大兔子 提交于 2019-11-26 19:14:21
问题 So I've got what seems to be a common problem, which is that the EditText in my dialog box doesn't show up when it gets focus. I've seen several workarounds, such as in this thread, this one and this one (and many more), but I have never seen a satisfactory explanation for why this is happening in the first place. I would much prefer to have android use its own default behavior for EditTexts than to build my own, but it seems like everyone (in those threads) has accepted that the default

How to move the layout up when the soft keyboard is shown android

柔情痞子 提交于 2019-11-26 18:30:15
I have a login screen with two EditTexts and a login button in my layout. The problem is that, when I start typing, the soft keyboard is shown and covers the login button. How can I push the layout up or above the keyboard when it appears? I do not want to use a ScrollView , just want to implement it without scrolling down. Please, suggest me some way of doing it. Thanks in advance. jeet Set windowSoftInputMode property to adjustPan and adjustResize <activity android:windowSoftInputMode="adjustPan|adjustResize"> </activity> jency Try this in the android manifest file corresponding to the

Only show number buttons on Soft Keyboard in Android?

笑着哭i 提交于 2019-11-26 17:43:28
问题 On the soft keyboard in Android you can set the soft keyboard to show the numbers instead of a-z keyboard using android:inputType="numberDecimal" . However, what do I do if I only want to show the top number row 1 2 3 4 5 6 7 8 9 0 and not the following rows starting with @ # $ % ... ? Thanx for listening! 回答1: You must only add this line on your code: input.setRawInputType(Configuration.KEYBOARD_12KEY); this will show only the numeric keyboard. 回答2: android:inputType="phone" android:digits=

Creating a SoftKeyboard with Multiple/Alternate characters per key

大憨熊 提交于 2019-11-26 17:05:20
I've followed the examples on developer.android.com regarding Input Methods and played with the SoftKeyboard sample application. These together give more than enough information regarding the creation of simple keyboard. What I can't see in the API is the ability to create alternate / multiple characters per key which is available on the standard Keyboard (LatinIME Keyboard). The above image is the result of a long press on the "a" key. When you long press a key it's possible to populate a popup with alternate characters. It is also possible to give a popup hint on some keys which will prompt

How to change background color of key for android soft keyboard?

橙三吉。 提交于 2019-11-26 16:32:19
问题 I am implementing custom keyboard on Android. I have just read documentation on "developer.android.com" and seen sample with soft keyboard. All I can - it`s to change keyboard background, change placement of buttons, set keyIcon instead of keyLabel to key. But I still can not change key`s background and color. Please write some sample code of XML or source. Thanks! My sample where I change background: public class GBInput extends InputMethodService implements KeyboardView

AlertDialog with EditText, open soft keyboard automatically with focus on EditText doesn't work

安稳与你 提交于 2019-11-26 16:30:41
问题 I'm trying to get a piece of code work which should focus an EditText in an AlertDialog as soon as it shows and then automatically open the soft keyboard. Instead, it just makes the screen go darker. Builder builder = new Builder(this); final EditText input = new EditText(this); AlertDialog dialog = builder.create(); builder .setTitle(R.string.dialog_title_addsubject) .setMessage(R.string.dialog_addsubject) .setView(input) .setPositiveButton(android.R.string.ok, new DialogInterface

Android Hide Soft Keyboard from EditText while not losing cursor

喜欢而已 提交于 2019-11-26 16:26:50
问题 I've come about as far as this which gets me halfway there, but not quite. I have a dialer Fragment that has all the usual Button s to enter a number including backspace, so I don't need the soft keyboard. I'd also like to give the user the ability to paste text (long click... works fine per default), as well as to edit what has been entered so I need the cursor. The easiest way I found to make sure the soft keyboard doesn't pop up if the user clicks inside the EditText is to set the

Showing Android's soft keyboard when a field is .focus()'d using javascript

人盡茶涼 提交于 2019-11-26 16:09:23
问题 In a web-page I've got a search field. I've added a "clear" button so that users can clear the search field and start again. As a convenience, I focus the search field's text box and the cursor does appear in the box. However the soft keyboard does not seem to show up on android devices that use the default browser. In iOS and Opera Mobile it works as I'd expect. Is there an additional method I can call that will cause the keyboard to show on Android's browser so the user can start typing

Show soft keyboard even though a hardware keyboard is connected

拈花ヽ惹草 提交于 2019-11-26 16:07:33
问题 Is there any way to show software keyboard with USB keyboard connected (in my case RFID reader)? I tried to force show it using InputManager (with these or similar parameters), but with no luck ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED,0); Important notice - I know that there is a button in status/system bar to show it, but this button is not visible to user (Kiosk app). 回答1: You need to override the InputMethodService

Open soft keyboard programmatically

拈花ヽ惹草 提交于 2019-11-26 16:06:59
I have an activity with no child widgets for it and the corresponding xml file is, <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/myLayout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:focusable="true" > </LinearLayout> and I want to open soft keyboard programmatically while the activity gets start.and what I've tried upto now is, public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);