android-softkeyboard

Android - add next and prev button to softkeyboard which appears on click of an edit text in my activity

匆匆过客 提交于 2019-11-30 22:23:38
I need to add the NEXT and PREV button to my soft keyboard which appears on clicking on an edit text field in my activity page. Kindly provide me with the pointers for tutorials on implementing this concept. Thanks in advance. You can do it in xml by android:imeOptions="actionNext" or by programatic by yourEditText.setImeOptions(EditorInfo.IME_ACTION_NEXT); There is method for EditText myEditText.setImeOptions(EditorInfo.IME_ACTION_NEXT); By using above method you can add Next Button to soft keyboard. You can refer the link for more information For more info 来源: https://stackoverflow.com

Android - add next and prev button to softkeyboard which appears on click of an edit text in my activity

冷暖自知 提交于 2019-11-30 17:28:24
问题 I need to add the NEXT and PREV button to my soft keyboard which appears on clicking on an edit text field in my activity page. Kindly provide me with the pointers for tutorials on implementing this concept. Thanks in advance. 回答1: You can do it in xml by android:imeOptions="actionNext" or by programatic by yourEditText.setImeOptions(EditorInfo.IME_ACTION_NEXT); 回答2: There is method for EditText myEditText.setImeOptions(EditorInfo.IME_ACTION_NEXT); By using above method you can add Next

Positioning EditText Above Keyboard

十年热恋 提交于 2019-11-30 17:27:49
I have got an EditText looking like this (with "bottom gravity"): When I press the EditText , the keyboard shows up and I can't see anymore what I'm typing (because the EditText is now behind the keyboard, on the bottom). How could I move the EditText automatically just above the keyboard, when it has been pressed? At the end, it would be good if it would look like this: My Code: // LINEAR LAYOUT LinearLayout layout = new LinearLayout(getApplicationContext()); layout.setOrientation(LinearLayout.VERTICAL); setContentView(layout); // TEXTVIEW layout.addView(tv); // EDITTEXT et.setGravity(Gravity

How to change color of keys in KeyboardView Class in custom Android keyboard? [duplicate]

纵饮孤独 提交于 2019-11-30 15:16:43
This question already has an answer here: How to change background color of key for android soft keyboard? 2 answers How to change background color or theme of keys dynamically in Custom Keyboard Android 2 answers I am working on a Custom Keyboard App. I need to set different themes for keys or background color in KeyboardView class and get key color at onCreateInputView() in SoftKeyboard extends InputMethodService Class. However I am not getting how to get particular key according to keycode so I can change color or background of particular key. Yakov On any diffrent input layout use android

Why doesn't android:windowSoftInputMode=“stateVisible|adjustResize” adjust the screen when soft keyboard is shown?

独自空忆成欢 提交于 2019-11-30 15:13:34
I can't seem to make the android:windowSoftInputMode="stateVisible|adjustResize" option work. When the soft keyboard shows, the scroll view doesn't automatically scroll to the bottom part. Edit : I tried using adjustPan instead (stateVisible|adjustPan) but what happens is the scroll view gets disabled. Solution : Finally, I found a suggestion that works. I created an OnGlobalLayoutListener() and added it to my scroll view. I checked if the height of the root view of my activity(which is my scroll view) changed. If yes, I'm assuming that the soft keyboard is shown. Click here for more info.

Android disable Enter key in soft keyboard

亡梦爱人 提交于 2019-11-30 14:53:26
问题 Can anyone tell me how to disable and enable the Enter key in the soft keyboard? 回答1: just go to your xml and put this attribute in EditText android:singleLine="true" and your enter key will be gone 回答2: Attach OnEditorActionListener to your text field and return true from its onEditorAction method, when actionId is equal to IME_ACTION_DONE. This will prevent soft keyboard from hiding: EditText txtEdit = (EditText) findViewById(R.id.txtEdit); txtEdit.setOnEditorActionListener(new

Android - Soft Keyboard pushes layout of my activity out of screen

爱⌒轻易说出口 提交于 2019-11-30 14:32:40
问题 My activity's layout is as shown below. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <FrameLayout android:id="@+id/title_bar" android:layout_width="fill_parent" android:layout_height="25dip" android:background="@drawable/bg_title" /> <LinearLayout android:id="@+id/main" android:width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1">

Can I use the soft keyboard without an EditText?

只愿长相守 提交于 2019-11-30 13:45:46
问题 I'm creating a simple typing game in Android. I have no problem getting input from the physical keyboard, but now I'm trying to get the soft keyboard to appear without the EditText. So far, I've tried the following: 1. EditText with visibility="invisible" and this line: ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(keyboard_edittext, InputMethodManager.SHOW_FORCED); // SHOW_IMPLICIT also failed 2. This line in the onCreate() : this.getWindow()

Android key event for back key when soft keyboard is shown?

纵饮孤独 提交于 2019-11-30 12:42:33
I am trying to capture the "back" key event when the soft keyboard is shown. I am using SDK ver 8 and can successfully capture the back key event ONLY when the soft keyboard is HIDDEN as follows: @Override public void onBackPressed() { // do something super.onBackPressed(); } The problem is that the system is not calling this method while the soft keyboard is shown. I have tried to log onKeyDown/Up() methods as well as the above method to work out what is happening in this scenario to no avail. See below: @Override public boolean onKeyUp(int keyCode, KeyEvent event) { //DEBUGGING Log.d(TAG +

html phonegap android : numeric soft keyboard has next instead of go button

a 夏天 提交于 2019-11-30 12:32:25
This is driving me crazy and I can't find the answer anywhere. I have forms in my phonegap app. If the input type="text", the text keyboard pops up and "go" is displayed in the corner. When you click go, it submits the form. That all works as I would expect. But if I use input type="number", the number keyboard pops up and "next" is displayed in the corner. When you click next, if there is another input box before the button tag, it goes to that input. That's okay. . . not ideal, but makes sense. But if it is the last input field on the page, click "next" does nothing. It doesn't put focus on