android-softkeyboard

How to display custom keyboard when clicking on edittext in android

穿精又带淫゛_ 提交于 2019-11-29 04:51:19
问题 I have a custom keyboard in my application. question is How to didplay this keyboard when click on the edittext.I an using setonfocuschangre listener ,now the custon keyboaed appears when the edittext focus is changed.but i want to show this keyboard whenever i click on the edittext..one info I forget to put here the edittext is within the fragment. 回答1: I created a Custom Keyboard in my application using Keyboard tag. I am adding this keyboard in a RelativeLayout on my screen like. private

Read Keyboard events in Android WebView

◇◆丶佛笑我妖孽 提交于 2019-11-29 01:45:35
I'm trying to listen to key events in android web view. Example when user is filling a form, I should receive the key events. This is my WebView code public class MyWebView extends WebView implements OnKeyListener { ..... @Override public boolean onKeyDown(int keyCode, KeyEvent event) { Log.i("PcWebView", "onKeyDown keyCode=" + keyCode); return super.onKeyDown(keyCode, event); } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { Log.i("PcWebView", "onKeyUp keyCode=" + keyCode); return super.onKeyUp(keyCode, event); } @Override // Listener is initialized in the constructor public

Unable to show keyboard automatically in the SearchView

空扰寡人 提交于 2019-11-29 01:16:40
The SearchView is focused by default, but when I try to show software keyboard - it doesn't happen: InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0); But when I click on the SearchView - it does. Why? Fixed! mSearchView.setOnQueryTextFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean hasFocus) { if (hasFocus) { showInputMethod(view.findFocus()); } } }); And private void showInputMethod(View view) { InputMethodManager imm = (InputMethodManager)

detecting android softkeyboard show/hide events

吃可爱长大的小学妹 提交于 2019-11-28 23:29:22
I am trying to detect showKeyboard and hidekeyboard events on phonegap. For that purpose, on deviceready event I placed following code: bindEvents: function() { document.addEventListener('deviceready', this.onDeviceReady, false); }, // deviceready Event Handler // // The scope of 'this' is the event. In order to call the 'receivedEvent' // function, we must explicity call 'app.receivedEvent(...);' onDeviceReady: function() { document.addEventListener("menubutton",app.onMenuKeyPress,false); document.addEventListener("backbutton",navigateBack,false); document.addEventListener("hidekeyboard",

Android Soft keyboard action button

£可爱£侵袭症+ 提交于 2019-11-28 22:27:42
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? 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 . to navigate the focus to the next edit field add android:imeOptions="flagNavigateNext" and for dismissing the softkey

Coordinatorlayout adjustresize not working

删除回忆录丶 提交于 2019-11-28 21:18:51
MY CODE (and more): I have a Coordinator Layout as follows <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapse_toolbar" android:layout_width="match_parent" android:layout_height="280dp" android:fitsSystemWindows="true" app:contentScrim="@color/transparent" app

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

↘锁芯ラ 提交于 2019-11-28 21:16:10
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 there a way to - via Javascript - disable this behaviour or detect for it so I can make changes to the code

Keyboard hiding EditText when android:windowTranslucentStatus=true

馋奶兔 提交于 2019-11-28 20:11:27
We're applying the new Android KitKat translucent theme in our apps, and we're getting a weird issue when the keyboard appears. If we don't use the new android:windowTranslucentStatus attribute, all works as usual: The screen is resized, and all remains visible. But when we're using android:windowTranslucentStatus , the screen isn't resized and our EditText becomes hidden by the keyboard. A sample of the issue: The only difference between the screens is in the attribute in the style: First screen: <item name="android:windowTranslucentStatus">false</item> Second screen: <item name="android

Implementing onKeyPreIme(int keyCode, KeyEvent event) in Fragment

こ雲淡風輕ζ 提交于 2019-11-28 19:40:57
I cannot figure how to implement onKeyPreIme(int keyCode, KeyEvent event) in a Fragment . @Override public boolean onKeyPreIme(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) { // do your stuff return false; } return super.dispatchKeyEvent(event); } I tried a lot but nothing works. Also, I could not find anything on Google or Stack Overflow. I would like to perform an action when the back key is pressed and the softkeyboard is up. Setting an onKeyListener on my EditText s did not work, since KeyEvent.KEYCODE_BACK is not called

WebView hides soft keyboard during loadUrl(), which means a keyboard cannot stay open while calling javascript

谁说我不能喝 提交于 2019-11-28 19:36:47
Since the way you call javascript on a WebView is through loadUrl("javascript: ... "); The keyboard cannot stay open. The loadUrl() method calls loadUrlImpl() , which calls a method called clearHelpers() which then calls clearTextEntry() , which then calls hideSoftKeyboard() and then we become oh so lonely as the keyboard goes away. As far as I can see all of those are private and cannot be overridden. Has anyone found a workaround for this? Is there a way to force the keyboard to stay open or to call the javascript directly without going through loadUrl()? Is there anyway to override the