android-softkeyboard

How to hide keyboard on dialog dismiss

梦想的初衷 提交于 2019-12-10 03:41:55
问题 I have an Activity with single Fragment on it. There is one EditText on the fragment. The keyboard is popping up as soon the fragment is shown, however I managed to block it setting in the manifest android:windowSoftInputMode="stateHidden" However, there also is a button, which opens a dialog with another EditText. I have a method that automatically closes the keyboard on dialog dismiss. public static void closeInput(final View caller) { caller.post(new Runnable() { @Override public void run(

How to catch a soft keyboard 'enter/done' press?

北城以北 提交于 2019-12-10 03:09:32
问题 I would like to know when the user presses the 'enter/done/next' key on the soft keyboard without the activity knowing which edittext box the user is in. I have seen some code, but it always uses the name of the edittext box that is being edited. The app has numerous edittext boxes, and calculations are re-run anytime any one of the values in a edittext box is changed. 回答1: Then attach the OnEditorActionListener to all of them. 来源: https://stackoverflow.com/questions/5330243/how-to-catch-a

Android app crashes when switching Fragment after showing a keyboard that is set with nextFocusDown

只愿长相守 提交于 2019-12-10 02:08:12
问题 I have an app that was working nicely with multiple fragments that are switching based on a navigation bar interaction. One of the screens has multiple text fields, and I decided to order these fields so the keyboard "next" would automatically take the user to the next fillable text field by using nextFocusDown . The last one leads to RadioGroup which results in the "done" button being shown. The fields look like this (they are within LinearLayout that is within a NestedScrollView within

How to push up the whole view when a keyboard comes up, what layout changes needed? [duplicate]

懵懂的女人 提交于 2019-12-09 20:48:32
问题 This question already has answers here : Move layout up when soft keyboard is shown (7 answers) Closed 3 years ago . I am having trouble pushing up the entire recycler view when the keyboard is diplayed, it cuts off the message that is previous. I am create a chat view that looks like this xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/commentsParentLayout" android:layout_width="match_parent" android

How to hide android keyboard in search view

末鹿安然 提交于 2019-12-09 15:12:01
问题 I've used search view in my application. I wonder how to hide the keyboard when i hit the search button on the search view? I have to use the back button to view the results. 回答1: Here is a similar question: How to dismiss keyboard in Android SearchView? @Override public boolean onQueryTextSubmit(String query) { // Do search. searchView.clearFocus(); return true; } 回答2: Try this code: private void hideKeyboard(){ InputMethodManager inputManager = (InputMethodManager)getSystemService(Context

Dont want soft keyboard to automatically show on launch - Android [duplicate]

送分小仙女□ 提交于 2019-12-09 14:57:00
问题 This question already has answers here : How to stop EditText from gaining focus at Activity startup in Android (52 answers) Closed 6 years ago . Everytime I open my android app, it automatically focuses the edittext box and the soft keyboard opens up. Is there a way to focus something else on start up so the keyboard doesnt show right away? 回答1: You can try: android:windowSoftInputMode="stateHidden" for your activity in AndroidManifest.xml 回答2: Add this two lines to you main layout. android

Android - Global Layout Listener not working

我怕爱的太早我们不能终老 提交于 2019-12-09 12:11:44
问题 I used the code from Reuben Scratton's new answer in this question. When I paste it into my code, I get red squigglies underneath addOnGlobalLayoutListener(new OnGlobalLayoutListener() , onGlobalLayout() , and activityRootView (after heightDiff). Please help me figure out what is wrong. Thanks Here's my code on the .java page public class Details extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature

Android softkeyboard popup view on key long press

时光毁灭记忆、已成空白 提交于 2019-12-09 06:07:53
问题 I am developing Android soft keyboard: public class CustomKeyboard extends Keyboard{...} public class CustomKeyboardView extends KeyboardView{...} public class CustomKeyboardIME extends InputMethodService implements KeyboardView.OnKeyboardActionListener{...} On some keys, I have popupKeyboard and popupCharacters: <Key android:codes="144" android:keyLabel="0" android:popupKeyboard="@xml/key_popup" android:popupCharacters=")" android:keyEdgeFlags="right"/> xml/key_popup.xml: <Keyboard xmlns

Scroll textfield up when keyboard popsup

点点圈 提交于 2019-12-09 06:01:47
问题 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. 回答1: 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; $(

display built-in emoji keys for inputmethod

半世苍凉 提交于 2019-12-09 05:27:56
问题 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