android-softkeyboard

Android disable Enter key in soft keyboard

白昼怎懂夜的黑 提交于 2019-11-30 12:17:51
Can anyone tell me how to disable and enable the Enter key in the soft keyboard? just go to your xml and put this attribute in EditText android:singleLine="true" and your enter key will be gone Shankar Agarwal 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 OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if

how to listen to keyboard search button in searchView

主宰稳场 提交于 2019-11-30 11:20:15
I have a SearchView. When the user clicks on the keyboard search button, I need to make a server call. What does the code for the listener look like? I am thinking I have to use OnClickListener. But the internal code for knowing it's the search button, I am not sure how to determine that. I have done like this the onQueryTextSubmit is the method you are looking for. set setOnQueryTextListener on your search view. @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu);

Android soft keyboard in a fullscreen Surface View

China☆狼群 提交于 2019-11-30 09:53:51
问题 HI! I am currently extending an Android Game Framework,which I found in a Book written by Mario Zechner (who also develops Libgdx). It is working great so far and I accomplished a Java Desktop Implementation of the Framework. But one tiny thing is missing, the correct usage of the SoftKeyboard. You can try out and reproduce my bug , the whole project is on github, and the android module is the "app"folder. The java version (left arrow key = key back) is in the javalib module. https://github

Android soft keyboard hides inputs from CordovaWebView when in fullscreen

若如初见. 提交于 2019-11-30 09:24:49
I have a CordovaWebView that presents some html forms. When i focus on an input field, the Android's soft keyboard pops up and, for certain fields, according to their position, it gets on top of it. Basically, it is not resizing the layout of CordovaWebView. Whatever i do, i can't change this, and it is said that it is related to the fact that the CordovaWebView is in fullscreen mode. How can i accomplish to resolve this? PS: is it, or not, a bug? Thank you all! In fact, it is a well know bug, as @user2493245 said. But I found a workaround, at least regarding my specific case. on WebView, just

Get keyboard language or detect user input language in Android

独自空忆成欢 提交于 2019-11-30 09:14:19
Problem Description I'm trying to detect current selected language of the keyboard. For that purpose I use following code: Code /* Return the handle to a system-level service by name. The class of the returned * object varies by the requested name. */ InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); /* Returns the current input method subtype. This subtype is one of the subtypes in the * current input method. This method returns null when the current input method doesn't * have any input method subtype. */ InputMethodSubtype ims = imm

How to show the soft keyboard on native activity

两盒软妹~` 提交于 2019-11-30 09:09:53
When I try to use ANativeActivity_showSoftInput() , it doesn't bring up the soft keyboard. I have tried using ANativeActivity_showSoftInput(engine->app->activity, ANATIVEACTIVITY_SHOW_SOFT_INPUT_FORCED) and ANativeActivity_showSoftInput(engine->app->activity, ANATIVEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT) to show softinput, but also failed. I read the source code, and I found after start nativeActivity , NativeContentView(extend View) will be created, and when call ANativeActivity_showSoftInput , it will call showSoftInput() in java side. I think maybe the softkeyboard is not turned on. Can you

Listen for keyboard show or hide event in android [duplicate]

久未见 提交于 2019-11-30 08:55:46
问题 This question already has answers here : How to capture the “virtual keyboard show/hide” event in Android? (15 answers) Closed 4 years ago . I am trying to listen for events that occurs when the keyboard is shown or hidden. Is this possible in Android? I am not trying to figure out if the keyboard is shown or hidden when I start my activity, I would like to listen for events. 回答1: Try below code:- // from the link above @Override public void onConfigurationChanged(Configuration newConfig) {

Can I use the soft keyboard without an EditText?

泪湿孤枕 提交于 2019-11-30 08:26:05
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().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); This method actually displayed an

How can I focus on a collapsible action view EditText item in the action bar (when it is expanded) and force the soft keyboard to open?

跟風遠走 提交于 2019-11-30 08:12:31
I am using Jake Wharton's excellent ActionBarSherlock library and have a collapsible search action view. I want to popup the soft keyboard when the search action view is expanded. We can read a recommended way of doing this in a DialogFragment in the " Using DialogFragments " blog post by Google (altered a bit for readability). // Show soft keyboard automatically mEditText.requestFocus(); int mode = WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE; getDialog().getWindow().setSoftInputMode(mode); This does not seem to work when expanding and requesting focus on a collapsable EditText action

Hiding the android keyboard for EditText

℡╲_俬逩灬. 提交于 2019-11-30 07:58:08
问题 Whenever I click in the EditText the Android keyboard popup window appears, but I don't want the keyboard to pop up. I want to permanently hide the android keyboard popup for my current application. How can I do this? 回答1: Setting the flag textIsSelectable to true disables the soft keyboard. You can set it in your xml layout like this: <EditText android:id="@+id/editText" ... android:textIsSelectable="true"/> Or programmatically, like this: EditText editText = (EditText) findViewById(R.id