android-softkeyboard

Android Soft keyboard action button

我们两清 提交于 2019-11-27 14:20:56
问题 My layout has 4 EditText views and a submit Button view. I need to have "Next" button for the first 3 EditText's and a "Done" button for 4th EditText field in place of a "New Line" key of soft keyboard. How can this be done? 回答1: In your layout, just set the XML attributes android:imeOptions="actionNext" for your first three text boxes and android:imeOptions="actionDone" for the last one. See: android:imeOptions documentation Also, there's a small XML example in the training docs. 回答2: to

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

谁都会走 提交于 2019-11-27 13:52:56
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.OnClickListener() { public void onClick(DialogInterface dialog, int which) { String value = input.getText()

Preventing viewport resize of web page when android soft keyboard is active

社会主义新天地 提交于 2019-11-27 13:40:35
问题 I'm developing a Javascript/JQuery plugin for Responsive Web Design. It has a function that monitors the viewport for changes, specifically resize and orientation. When a change is detected, a corresponding callback function is called. However, I just noticed that on Android (specifically using the stock browser on a Google Galaxy Nexus), if the user tries to use the soft keyboard, it resizes the viewport, thus firing the callback function. This is behaviour I would like to eliminate. Is

Android Hide Soft Keyboard from EditText while not losing cursor

瘦欲@ 提交于 2019-11-27 13:34:09
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 inputType to null - but that kills the cursor as well. So, how do I declare my EditText and what kind of

Why does setting imeActionId with a predefined ID resource create an error?

梦想的初衷 提交于 2019-11-27 13:16:31
Cyril Mottier has a great post on customizing the send/done/return key on the Android soft keyboard . When trying out the code, I (and several others in the comments) noticed that setting the imeActionId with a new ID in XML (e.g. @+id/...) returns a 0 to the OnEditorActionListener, when the key is hit by the user, not the unique ID. However, if you set an ID in ids.xml and set imeActionId to that (e.g. w/ @id/...) it causes a layout inflation error. The only way I could successfully get the imeActionId to be set to a unique ID was to set it programmatically in Java. So what is the correct

Programmatically hide/disable emoticons on Android soft keyboard

ぐ巨炮叔叔 提交于 2019-11-27 13:07:09
Is it possible to hide a specific keyboard button? I have an EditText and on some devices its keyboard has smiley faces while on other devices it is missing. I want to hide it on all devices. Below is the XML for my EditText : android:id="@+id/text_editor" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignWithParentIfMissing="true" android:layout_centerVertical="true" android:layout_toLeftOf="@+id/send_side" android:hint="Enter your text" android:imeOptions="actionSend|flagNoEnterAction" android:inputType="textLongMessage|textAutoCorrect

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

亡梦爱人 提交于 2019-11-27 12:55:39
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 right away? function clear_search() { if($('#searchinput').val()) { $('#searchinput').val(''); } $('

Android custom numeric keyboard

半世苍凉 提交于 2019-11-27 12:50:56
I want to add numeric keyboard like the one in vault application I don't know how to call it and how can I find in google ? Use TableLayout to create the numeric keyboard layout. Bind View.OnClickListener on each custom key view to response user input. In responses, append or delete text to that password field which implements by EditText.You can use append() or setText() to control what will be filled in the password field. I write a custom view for reusing in anywhere, here is the code: KeyboardView.java public class KeyboardView extends FrameLayout implements View.OnClickListener { private

How to hide the BottomNavigationView below keyboard with adjustResize set

本小妞迷上赌 提交于 2019-11-27 12:48:16
问题 According to the material design spec, when the keyboard appears, the BottomNavigationView should hide underneath it. However, if I set android:windowSoftInputMode="adjustResize" in the Activity's manifest then the BottomNavigationView moves above the keyboard. I need to set adjustResize to enable scrolling to the bottom of the screen while the keyboard is open. However, I do not want the BottomNavigationView to be visible. Can this be done? How it currently looks: The layout XML (in reality

Android Keyboard with Emoji

倖福魔咒の 提交于 2019-11-27 12:44:59
So I want to have a keyboard in my app that has emoji just like Whatsapp or Hangouts. How can I do that? I want to leave my key keyboard as it is I just want to add tabs to put emojis. I would think it would be easily supported by the soft keyboard but I can find nothing so far. Anyone could tell how to do it? UPDATE: The keyboard with emoji is included in Android KitKat and can be accessed by long pressing the new line button in the keyboard. The Hangouts keyboard however has the emoji icon visible instead of the "new line" key. If someone knows how to make this the default (either in layout