Android : How To Hide Soft Input Like Using BACK Buton?

Jul 11, 2009

In my app I have AutoCompleteTextView and "search" button. When user clicks "enter" or "search" an Intent is fired and new Activity is started. But in that "new" Activity SoftInput should be invisible, so I make ((InputMethodManager)getSystemService (INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(this.getCurrentFocus ().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); But when user clicks BACK and returns to activity with form he is unable to show soft input back by touching AutoCompleteTextView. He mus use trackball to select "search" button and than touch ACTextView. Bud when he is in "form" activity first time, shows soft input by touching AutoCompleteTextView and presses BACK button he is able to show soft Input by touching field. How can I hide soft input "correctly" (so it can be shwed back in intuitive way?) or hide it like BACK button does?

Android : How to Hide Soft input like using BACK buton?


Android : Way To Hide Soft Keyboard?

Oct 4, 2010

I need to be able to hide the soft keyboard in response to clicking a button. I have seen numerous posts on this subject and it seems that the solution is to use the InputMethodManager, but I have been unable to get it to work for me.

View 1 Replies View Related

Android :: Hide Soft Keyboard On Done Keypress?

Aug 5, 2010

I am struggling with the done button on the soft keyboard. I can't get the soft keyboard Done keypress to hide the keyboard. From another button, it works perfectly with imm.hideSoftInputFromWindow(editText.getApplicationWindowToken(), 0);
but the onKeyListener does not function the way I want. When I hit the editText, the soft keyboard shows up and its content is cleared from characters. The main.xml:

<EditText android:id="@+id/answer"
android:layout_gravity="center_horizontal" android:textSize="36px"
android:inputType="phone" android:minWidth="60dp" android:maxWidth="60dp" />

The Java file:
private EditText editText;...
editText = (EditText)findViewById(R.id.answer);
editText.setOnClickListener(onKeyboard);
editText.setOnKeyListener(onSoftKeyboardDonePress); ...
// method not working: private View.OnKeyListener onSoftKeyboardDonePress=new View.OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getKeyCode() == KeyEvent.FLAG_EDITOR_ACTION) {
// code to hide the soft keyboard
imm = (InputMethodManager) getSystemService( Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editText.getApplicationWindowToken(), 0); }
return false; } };
private View.OnClickListener onKeyboard=new View.OnClickListener() {
public void onClick(View v) { editText.setText(""); } };

The working method using a button (in the same java file):
private View.OnClickListener onDone=new View.OnClickListener() {
public void onClick(View v) { ....
// code to hide the soft keyboard
imm = (InputMethodManager) getSystemService( Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editText.getApplicationWindowToken(), 0); } };
When I press key no "9" the keyboard hides.

View 2 Replies View Related

Android :: Close/hide The Soft Keyboard

Jul 10, 2009

I'm having an EditText and a Button in my layout. After writing inside the edit field and clicking on the Button, I want to hide the virtual keyboard. I guess there should be a simple, one- or two-liner to make this happen. Where can I find an example of it?

View 5 Replies View Related

Android :: Hide Views When The Soft Keyboard Is Up?

Nov 1, 2010

I have a pretty standard search edit widget on top / search results list widget on bottom activity in my app. Below the results list widget I also have my view for ads. When the soft keyboard is brought up in this activity, I'd like to hide the view the ads are in because they consume too much screen space. I tried making that view android:isScrollContainer="true" but that had no effect.

So the question is, how can I ensure that certain views will be hidden when the soft keyboard is brought up?

View 3 Replies View Related

Android :: Hide Soft Keyboard Not Working

May 9, 2010

I'm developing on the Droid Incredible (and have tested on a 1.5 AVD Emulator as well), and one of the tabs in my tab widget consists of a listview and a row with an EditText and a Send button (for a chat feature). I am using the following to close the soft keyboard once I click Send, but it's not working. This is identical to code I've found elsewhere that people have upvoted as correct.

See anything I'm missing?

CODE:.......

I also tried changing the flag to 0. No luck. Anyone know what's up? Just realized I was originally using hideSoftInputFromInputMethod() instead of hideSoftInputFromWindow(). Changing it didn't make it work though...

View 1 Replies View Related

Android :: How To Hide Soft Keyboard In WebView ?

Nov 2, 2010

For an EditText view i can use setInputType(InputType.NULL), but an web view doesn't have it. I tried the rest of the solutions posted on stackoverflow but none of them worked for a web view.

View 1 Replies View Related

Android :: How To Detect / When Soft Input Is Gone?

Oct 20, 2009

When I press back button, soft input keyboard is gone. How can I detect this event in my activity?

View 2 Replies View Related

Android :: Soft Keyboard - New Input Framework

May 10, 2009

I have a class that extends ImageView, which also handles keyboard input, currently via OnKeyListener, which works great with the 1.1 sdk, but how do I port this to the 1.5 sdk? How do I get the soft keyboard to load for this View? I haven't found a ton of documentation regarding the new input framework.

View 2 Replies View Related

Android :: Emote Button In Soft Keyboard Input

Oct 21, 2009

Does anyone know how to enable the emote button in soft keyboard input?

View 2 Replies View Related

Android :: Allow Only Decimal Numeric Input / Use Phone Soft Keyboard?

Apr 21, 2010

I am trying to do something that I thought would be simple, yet I still haven't found the right approach. I have a Edit Text field that should only accept unsigned decimal entries. Using android:input Type="number Decimal" in my layout xml file achieves this, however the soft keyboard that is raised with this input Type is the standard keyboard but just uses the alternate view with the number row on top. This is far from ideal for a field that only allows numbers. A much better soft keyboard for numeric entry is the "phone" one. It has all of the numbers and a decimal. Perfect!! Well, except that for the life of me I cannot figure out how to use both the phone keyboard AND allow only numeric entry. I've tried everything I can think of but if I use the phone soft keyboard then the input field also allows things like "(" and any of the other symbols available on that keyboard. Is there any way to get the nice big numeric buttons of the phone keyboard along with only allowing decimal entry? You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

View 3 Replies View Related

Android :: Input Method Manager - Keyboard (virtual / Soft)

Oct 8, 2009

Inside TextView.java, I have the following code.

InputMethodManager imm = (InputMethodManager)getContext ().getSystemService(Context.INPUT_METHOD_SERVICE); Log.d("tag", " fullscreenmode test: " + imm.isFullscreenMode());

and also, InputMethodManager imm = InputMethodManager.peekInstance(); Log.d("tag", imm.isFullscreenMode());

My phone is in landscape mode. My application has an EditText. My keyboard(virtual/soft) is not visible. I expect the above codes (written inside TextView.java) to print false. But it prints true. How is that possible?

View 2 Replies View Related

Android :: Default Adjust For Window Soft Input Mode

May 9, 2009

I got confused about whether the default value for android:windowSoftInputMode[1] was adjustResize or adjustPan and thought I might be able to help someone avoid similar confusion. The "Updating Applications for On-screen Input Methods" blog post[2] states that pan and scan is the default mode because it is the safest for existing applications and resize is often the preferred screen layout. But I believe it's a little more complicated than that.

If the outermost View in a layout is a ScrollView then it appears that the default is actually adjustResize. And this makes sense: if the View lives inside a ScrollView then it probably knows how to resize itself. I'm mostly basing this statement on trial and error, so it would be great if someone could confirm or correct me. Maybe this should be mentioned in the documentation at [1]? Or state that it is recommended that applications specify one or the other, rather than depending on the default?

View 2 Replies View Related

Android :: How To Know Whether SIP (Soft Input Panel - Keyboard View) Is Showing - Not?

Apr 27, 2009

I wonder it is possible to know whether SIP is showing to user or not. A user application(Activity) can show or hide the Soft Input through the Input Method Manager. There is some APIs to handle the SIP. But I can't find API to know status of SIP(it is on showing or hiding).

When SIP is showing to user. It disturbs the UI of the Activity. So Activity should know about the information related with upper case. How can I know that?

View 3 Replies View Related

Android :: Window Soft Input Mode Not Working Properly With ListView

Nov 9, 2010

I have a layout with a ListView that contains EditText objects that can requestFocus() when the user chooses to edit the list item. I make sure to call setSelection() on the ListView when this happens, and then have the EditText request focus and then use InputMethodManager.showSoftInput to show the soft keyboard. However, when this happens, the list view is being resized correctly, but the selected list item remains below the fold and the user has to scroll up. This is working properly on 2.2, but is failing on 2.1. Any ideas for making sure the list selection remains visible?

View 2 Replies View Related

Android :: Custom Dialog Displayed On Soft Input (User Info ID)

May 18, 2009

I have a custom dialog displayed to input user info (ID). This appears on top of an activity with an 'Done' button, however when the edittext is selected and the soft keyboard appears, the keyboard obscures the Done button at the bottom of the dialog. The documentation / blog posts are a little dry on info specifically for dialogs, what do I need to include to get the dialog to pan up or otherwise?

View 5 Replies View Related

Any Apps / Exposed Modules That Hide Soft Keys

Feb 22, 2014

I would like to know of any apps/exposed modules that hide the softkeys completely, like not fade out and dissapear but slide down to where you swipe up from bottoms of screen and they show up again. Any such apps?

View 1 Replies View Related

General :: Sony Xperia Z - Make Speaker Louder And Hide Soft Key Buttons After Root

Mar 17, 2013

Make my sony xperia Z speaker more louder & hide the soft key buttons after root

View 1 Replies View Related

Android :: Hide Soft Keyboard On Android After Clicking Outside EditText

Nov 12, 2010

Everyone knows that to hide a keyboard you need to implement:

CODE:............

But the big deal here is how to hide the keyboard when the user touches or selects any other place that is not an EditBox or the softKeyboard?

I tryied to use the onTouchEvent on my parent Activity but that only works if user touches outside any other view and there is no scrollview.

I tryed to implement a touch, click, focus listener without any success.

I even tryed to implement my own scrollview to intercept touch events but i can only get the coordinates of the event and not the view clicked.

Is there a standard way to do this? in iPhone it was really easy.

View 5 Replies View Related

Android :: Creation Of Buton In Widget

Feb 12, 2010

I am trying to write a code for an SMS widget. I wrote something that I can compil, and print on screen my first sms. When I click on next, nothing happend.

View 1 Replies View Related

Android :: Hide Soft Keyboard On Activity Without Any Keyboard Operations

Oct 13, 2010

I have a tabbed view with one Activity per tab, and when I switch from the first tab, which has a TextView, to the second tab, which only shows a clickable list, the soft keyboard is still there. I want it to go away.

I tried this:

CODE:.............

But this does not work, because there is no relevant view to provide, as there is no View on the screen that takes keyboard input.

View 1 Replies View Related

Android :: Hide Activity On BACK Key Without OnDestroy?

Oct 28, 2009

When user presses BACK key, my activity's onDestroy is called and then it is killed. Is there a way (by overridding Activity.onKeyDown??) to simply put the activity into background without killing it? I want the BACK key to act like the HOME key (which doesn't kill my app), except I want to show the activity immediately below my activity.

View 7 Replies View Related

Android :: Back Button - Soft Keyboard Related

Nov 4, 2010

My app contains a page with a form, a long list of EditTexts.

If you're entering text and click the back button, the soft keyboard is hidden. However different android versions behave in different ways. My 2.2 device hides the keyboard, and that's it. My 1.5 device hides the keyboard, and the 'back' onKeyDown/Up event is still activated.

This is very tricky... for the 1.5 device I need to know if the keyboard is being displayed when the back button is pressed, so that I can capture the back event and stop it continuing (all I want is for the keyboard to hide). But I've search all over this forum and there doesn't appear to be a sure way of doing this.

View 2 Replies View Related

Android :: Intercept Back Button From Soft Keyboard

Oct 15, 2010

I have the activity with several input fields. When activity started soft keyboard is showed. When back button pressed soft keyboard closes and to close activity need to press back button one more time.

So the question: is it possible intercept back button to close soft keyboard and finish activity in one press of back button without creating custom InputMethodService?

I know how intercept back button in other cases - onKeyDown() or onBackPressed() but in this case it's not works: only second press of back button is intercepted.

View 3 Replies View Related

Android : Want To Handle Back Button With Soft Keypad?

Nov 6, 2009

I have a simple edit control in my application and as expected the soft keypad comes up on tapping it. Now what I want to do is that when the user presses the back button, the activity should quit immediately without the soft keypad going down first. On handling the key event in my activity i found that the first 'Back' event is consumed by the keyboard and it does not even reach the activity. However once the soft keypad goes down, the events can be handled in my activity. Is there any way to override this behavior so that the back button first reaches my activity and I can quit immediately.

View 3 Replies View Related

Android :: Create A Soft Home - Back - Menu Button

Nov 9, 2009

I am working on a device that does not have a hardware Home, Back or Menu button. I am trying to create a soft keyboard with only these three keys but I have not been able to get it working. Does anyone have any insight into my problem?

I first looked into injecting keypresses into a WindowManager but this functionality seems to have been removed.

I then looked at creating a custom soft keyboard but that will not work either. Custom soft keyboards only inject their input into the text fields they are attached to. I can't send a Home, Back or Menu keypress to the Android system.

I finally got the Home button working by using this intent to tell Android to go to the Home screen: Intent HomeIntent = new Intent(); HomeIntent.setAction(Intent.ACTION_MAIN); HomeIntent.addCategory(Intent.CATEGORY_HOME);

Unfortunately, I have not found an Intent to send for Menu and Back.

View 2 Replies View Related

Android :: Soft Home - Menu - Back Keys In Status Bar

Mar 9, 2010

I have a device with no hard buttons, on which I need to get Android running. The basic port is done, but I need to provide access to Home, Menu, and Back. The Archos tablets put soft buttons in the status bar, and I'm told that the android-x86 folks have implemented this as well (though I haven't found it in their source yet).

View 2 Replies View Related

Android :: Virtual/soft Buttons For Home - Menu - Back - Search - Always On Top

Jun 9, 2010

How can I make an app or maybe service that looks like (Nexus One touch buttons) for the navigation keys (Home, menu,Back, Search)

The buttons should always be visibly and always stay on top and send the command to the app thats running.

Someone have ideas and sample codes how to do that?

*I see an app with name (Smart Taskmanager) wich always detect when you touch the right side of the screen and then detect when you slide the finger to left.

So I think its possible, with this function I think its possible to implementate the code to simulate the (Home, Meny, Back, Search) buttons.

*I also see and test an app wich show a "cracked display" always ontop so that tecnic maybe shold be useful to always show the buttons/bitmanp on top.

Thoose function, to show the button and catch the "touch event" and send the event to the active program, thats what i dont can figure out how to do.

View 2 Replies View Related

HTC Desire :: On Screen - Soft - Home - Menu And Back Buttons

Jun 4, 2010

Does anyone know if its possible to have on screen buttons on the Desire for Home, Menu and Back as I'm (perhaps unnecessarily) worried about wearing the buttons out so would rather be using virtual buttons on screen (even if that means losing a little of the display area).

View 12 Replies View Related

Motorola Droid :: Move Back And Forward Within Text On Soft Keyboard?

Nov 18, 2009

Sorry for the newb question. Of course you can tap in the right spot, but that is not very accurate. The d-pad on the hard keyboard works of course, but what about on the soft keyboard?

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved