android-softkeyboard

setImeOptions: why the “Done” button does not show on the soft keyboard?

微笑、不失礼 提交于 2019-12-03 08:16:58
问题 I try to set the "Done" button on the softkeyboard by using input.setImeOptions(EditorInfo.IME_ACTION_DONE); but the "Done" button simply does not show on the softkeyboard. Any suggestion please? public void modif(int position) { AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this); alert.setTitle("Modifica"); EditText input = new EditText(MainActivity.this); input.setImeOptions(EditorInfo.IME_ACTION_DONE); alert.setView(input); final Editable value = input.getText(); alert

Hide to show and hide keyboard in DialogFragment

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 07:35:39
In my dialog fragment, I am able to show the keyboard using getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT STATE_VISIBLE); but I am not able to hide it on dismiss . I've tried getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); and getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); neither of which work. I've also tried showing and hiding the keyboard using InputMethodManager inputManager = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);

Scroll textfield up when keyboard popsup

橙三吉。 提交于 2019-12-03 07:34:30
I am using html5/javascript/jQuery/css for mobile app development. I have multiple textareas in the app. When I click on that to input, keyboard popup (android tab). But the textarea stays where it's on that page. How can I scroll page when keyboard pops up. MikeM with jQuery, get the textarea's offset().top value then set document scroll position using scrollTop() var $htmlOrBody = $('html, body'), // scrollTop works on <body> for some browsers, <html> for others scrollTopPadding = 8; $('textarea').focus(function() { // get textarea's offset top position var textareaTop = $(this).offset().top

display built-in emoji keys for inputmethod

落爺英雄遲暮 提交于 2019-12-03 07:14:48
I'm building a custom soft keyboard for android and would like to add a layout to include the emoji keys similar to what the default android keyboard (AOSP) is doing. I've searched around but it seems that most people are trying to display custom emoji from images. I'm looking to show the built-in icons that comes with Android (as shown below): It seems that I should be able to use the Unicode characters to send images from the keyboard, but my first attempt seems to generate only the older versions of the emojis. How do I support the latest emoji the phone can handle? Also, how do I display

change the default android keyboard using ADB or java code

狂风中的少年 提交于 2019-12-03 07:14:20
问题 I am building a custom application that uses specific keyboard so when the user run the application, the default keyboard should be changed to my specific keyboard which name is hackers keyboard , How can I do that using java code or by calling adb command from java code , my device is rooted , again this is specific app and the company that I developing for require that. 回答1: You can use the ime command to set input method . $ adb shell ime usage: ime list [-a] [-s] ime enable ID ime disable

Android show softkeyboard with showSoftInput is not working?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 06:42:17
问题 I have created a trivial application to test the following functionality. When my activity launches, it needs to be launched with the softkeyboard open. My code does not work?! I have tried various "state" settings in the manifest and different flags in the code to the InputMethodManager (imm). I have included the setting in the AndroidManifest.xml and explicitly invoked in the onCreate of the only activity. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas

Android OnEditorActionListener() actionId give 0 when I click Done key

拜拜、爱过 提交于 2019-12-03 06:33:42
I have created one keyboard.When user enter numbers , its entering particular EditText.But When User click on Done key, it didn't go to setOnEditorActionListener but its closing the keyboard. This is my code : final EditText txtQty = new EditText(this); txtQty.setHeight(1); txtQty.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 42)); txtQty.setInputType(InputType.TYPE_CLASS_PHONE); txtQty.setImeOptions(EditorInfo.IME_ACTION_DONE); txtQty.setSelectAllOnFocus(true); txtQty.setTextSize(9); txtQty.setVisibility(View.VISIBLE); txtQty.setHint("0.0"); txtQty.setHighlightColor(R.color

Android: Remove Enter Key from softkeyboard

落爺英雄遲暮 提交于 2019-12-03 05:40:16
In my login form when user clicks on an EditText and presses the enter key, this inserts a new line, therefore increasing the EditText's size. Next moment, it returns to its previous place and prints a dot in the password field (which is the next field). I want to remove this enter key from the softkeyboard. Is it possible? I am afraid you can't do this. But one thing is you can handle the softkeyboard keyevents like this, edittext.setOnKeyListener(new OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode

Hide soft keyboard after dialog dismiss

被刻印的时光 ゝ 提交于 2019-12-03 04:11:54
问题 I want to hide soft keyboard after AlertDialog dismiss, but it's still visible. Here is my code: alert = new AlertDialog.Builder(MyActivity.this); imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); alert.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); } }); 回答1: In Manifest xml android:windowSoftInputMode="stateAlwaysHidden" It

Disable Software Keyboard in Android until EditText is chosen

会有一股神秘感。 提交于 2019-12-03 04:06:14
how can I prevent the software keyboard to disappear until a specific EditText is choosen? I have several EditTexts in my Layout when it is opened the first is automatically selected and the software keyboard is shown. I know i can disable this by setting android:focusable="false". But then it is impossible to click on the item and get the item displayed. What I want: The activity is started and the user sees all EditTexts, then he clicks on one and the software keyboard opens and stuff can be entered in the EditText. Is this possible? In your activity onCreate() getWindow().setSoftInputMode