android-softkeyboard

SoftKeyboard hiding EditText

泪湿孤枕 提交于 2019-11-27 04:22:17
问题 I have a layout that uses an EditText to let users search a database and populate a ListView. The EditText is about 2/3 of the way from the top of the screen (positioned over an ImageView, and followed by some intro text.) The problem is that the soft keyboard hides the EditText, so the user can't see what he's typing. (I disabled the auto-suggest.) I've tried LinearLayout, RelativeLayout, paddings, and different alignments/centerings, but I still can't get it to work right. The EditText is

Show soft keyboard in AlertDialog with a WebView inside (Android)

这一生的挚爱 提交于 2019-11-27 03:13:23
问题 In my Android app I create an AlertDialog that has a WebView inside. The WebView loads a webpage that requires the user to log in. However, when I click on text fields in the WebView , soft keyboard does not appear. I am aware of the issue in general (Android: Issue 7189); however, in my case the suggested solution does not seem to work since I use an external website, and not just a simple HTML form. The perfect solution would be if the keyboard appeared when the user clicked on the website

Android on-screen keyboard auto popping up

本小妞迷上赌 提交于 2019-11-27 02:32:56
One of my apps has an "opening screen" (basically a menu) that has an EditText followed by several Button s. The problem is that several of my users are reporting that when they open the app it's automatically popping up the on-screen keyboard without them even touching the EditText . As far as I can tell, all of these users are using the HTC Hero . Is this a bug in 1.5? Is there anything I can do about it? Donal Rafferty You can use the following line of code in the activity's onCreate method to make sure the keyboard only pops up when a user clicks into an EditText this.getWindow()

Show keyboard for edittext when fragment starts

别等时光非礼了梦想. 提交于 2019-11-27 01:43:58
问题 When my fragment starts, I want my edittext to be in focus/let user to just start typing in it. I am able to get it in focus with requestFocus(), but I cannot get the keyboard to show up. I have tried both this: edit = (EditText) view.findViewById(R.id.search); edit.requestFocus(); InputMethodManager imgr = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); imgr.showSoftInput(edit, 0); and edit = (EditText) view.findViewById(R.id.search); InputMethodManager

How can restrict my EditText input to some special character like backslash(/),tild(~) etc by soft keyboard in android programmatically

非 Y 不嫁゛ 提交于 2019-11-27 01:00:04
问题 I am developing an application for keyboard, but i am geting an issue. I want to restrict/block some special character from soft keyboard in EditText in android programmatically. So, Is there any way i can restrict any special character input in edit text in android. If anyone have idea,Please reply. Thanks in advance. 回答1: Try this may works for you public class MainActivity extends Activity { private EditText editText; private String blockCharacterSet = "~#^|$%&*!"; private InputFilter

EditText in Listview loses focus when pressed on Android 4.x

╄→гoц情女王★ 提交于 2019-11-27 00:54:38
I know there are a lot of similar questions out here but I couldn't get any of the provided solutions working in a simple sample app. The problem occurs when the softkeyboard is shown for the first time. As soon as it is shown, only by pressing the editText again makes it editable. Tried the following: android:windowSoftInputMode="adjustPan|adjustResize" This is not solving any issues. It seems that this line is mandatory to have the activity resized after the softkeyboard is popping up. Unfortunately, it's also causing any EditTexts to lose focus. This is probably to the ListView itself

Android EditText, soft keyboard show/hide event?

筅森魡賤 提交于 2019-11-27 00:53:51
Is it possible to catch the event that Soft Keyboard was shown or hidden for EditText? woodshy Hi I'd used following workaround: As far as my content view is a subclass of LinearLayout (could be any other view or view group), I'd overridden onMeasure method lilke following: @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final int proposedheight = MeasureSpec.getSize(heightMeasureSpec); final int actualHeight = getHeight(); if (actualHeight > proposedheight){ // Keyboard is shown } else { // Keyboard is hidden } super.onMeasure(widthMeasureSpec,

How to remove auto focus/keyboard popup of a field when the screen shows up?

不打扰是莪最后的温柔 提交于 2019-11-27 00:04:52
问题 I have a screen where the first field is an EditText, and it gains the focus at startup, also popups the numeric input type, which is very annoying How can I make sure that when the activity is started the focus is not gained, and/or the input panel is not raised? 回答1: InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0); or set activity property in manifest file as below in the application

Keep soft keyboard open when enter key is pressed

橙三吉。 提交于 2019-11-26 23:22:35
问题 Well, I'm trying to prevent the soft keyboard from closing when the user press the "ok" button after editing a text field. Actually, what i'm trying to achieve is : when "ok" button is pressed, the field is parsed and if valid, it starts another activity. That is easy enough. But, when the field is not valid, I want the soft keyboard to stay open. And that's... a hell more complicated. If anyone know how to achieve such a thing... Thanks in advance. EDIT : what I mean by the OK button is the

Android: how to make keyboard enter button say “Search” and handle its click?

我是研究僧i 提交于 2019-11-26 23:15:42
I can't figure this out. Some apps have a EditText (textbox) which, when you touch it and it brings up the on-screen keyboard, the keyboard has a "Search" button instead of an enter key. I want to implement this. How can I implement that Search button and detect press of the Search button? Edit : found how to implement the Search button; in XML, android:imeOptions="actionSearch" or in Java, EditTextSample.setImeOptions(EditorInfo.IME_ACTION_SEARCH); . But how do I handle the user pressing that Search button? Does it have something to do with android:imeActionId ? Robby Pond In the layout set