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
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
Oct 21, 2009
Does anyone know how to enable the emote button in soft keyboard input?
View 2 Replies
View Related
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
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
Sep 10, 2010
Is there any way out for mapping the Done button to the button on the screen in Android. What I want is that I have one login screen user enters username and presses the next button on the soft keyboard which brings the focus on password field. AFter entering password when the user presses done button then the action which is performed on login button should be called.
View 1 Replies
View Related
Jun 24, 2010
CODE:............
I have this at the top of my application. When the application starts, the EditText is orange highlighted and has a cursor in it; when the EditText is tapped, the soft keyboard pops up. The user uses it to type into the EditText.
However, when they click the Button, my onClick method fires and does everything it's supposed to, however the soft keyboard stays on screen and the EditText is still highlighted with its cursor.
I also have, at the top of the Button onclick: findViewById(R.id.name).clearFocus();
In spite of this, the EditText does not seem to clear its focus. How do I make the button actually act as if it is submitting the form?
Also, I do not transition to a different Activity on the click of the Button. I suppose that is the typical case, and probably the reason why they don't bother hiding the keyboard. However I want to keep the search box and button at the top of the screen, so I just dynamically fill and add views to the screen when the Button is pressed. How can I achieve my desired behavior?
View 1 Replies
View Related
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
Nov 7, 2010
Does anyone know how to intercept the genius button on the new MyTouch 4g by HTC? Is it somehow hard wired to the kernel?
I looked at logCat, and I see that if uses the following intent:
INFO/ActivityManager(1309): Starting activity: Intent { flg=0x10000000 cmp=com.nuance.android.vsuite.vsuiteapp/.VSuiteStartSession }
View 1 Replies
View Related
Jul 28, 2011
Can a program sit in the background and intercept keypresses, convert the keypresses from one letter to another, and send it to whatever program you are working in as though the new letter is what you typed?As qwerty is the only layout choice for hardware keyboards and I don't have root on my tablet, I want to use this as a work around.
If I were to press "s" on my hardware usb keyboard. The program would intercept the "s" before it got to whatever textbox and convert it into the dvorak key equivalent of "o". That o would then be passed to the program as a normal keypress.
if I were to press asdfg on the qwerty aoeui would be sent instead.I thought it best to ask before I waste hours trying to learn how to write the program.
List of changes I would make in a pseudocode case statement format.
Select Case Key
#Comment - Number Row Key changes
- = change to [
= = change to ]
#Comment - Top Row Key changes
q = change to '
w = change to ,
[code]...
View 2 Replies
View Related
Oct 20, 2010
I was wondering if it is possible to intercept keyboard input on a global level on Android. For example a user types in text into an edittext (does not matter which application) I would like to access said text to check for certain words. Is this even possible with Android's security model (yes I am aware this kind of feature could be used for various wrong things too).
View 1 Replies
View Related
Jul 30, 2009
In an activity, how do detect the fact that the user pressed the home button?
View 6 Replies
View Related
Feb 11, 2010
I am creating an Android service which constantly runs in the background. I'd like to be able to intercept calls to the power button to:
a) prevent the screen coming on
b) handle the power button press in a different manner.This is to enable the user to have a very simple interface to my application and prevent wasting battery powering up the screen when it is not required.
I will probably need an alternative mechanism to actually bring the screen back up (such as an extended key press or similar), but this only becomes relevant if what I'm after is possible.
View 2 Replies
View Related
Aug 13, 2010
I would like to play around with some ideas and develop a soft keyboard for Android to replace the default one.
Is there any general information about soft keyboard development for Android out there?
Any best practices or guidelines?
Can I do with my keyboard application pretty much anything I could do with a normal Android application?
Can I do HTTP connections to synchronize keyboard data with a cloud DB and other phones I have?
Can I open other windows/screens from a key press, e.g. to display a custom input interface different to a normal QWERTY one. If that doesn't work, can I use a pop-up dialog instead?
View 3 Replies
View Related
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
Jun 22, 2012
I'm using an MK802 mini PC. I don't have a USB keyboard yet.
When I plug in a wired USB mouse, I can use that to click on the on screen soft keyboard.
But when I plug in the wireless dongle for a USB mouse, the Android soft keyboard doesn't show anymore (I guess this is because the wireless dongle supports both keyboard and mouse, and tells Android a hardware keyboard is available, so Android doesn't show the soft keyboard).
Any way to ignore this and always show the soft keyboard? Or another keyboard I can download which will always show?
View 1 Replies
View Related
Jul 15, 2010
This is my first android device and i'm loving it... but one thing that irks me is the use, or lack thereof, of the back button.
As I am navigating menus and options in the Settings, I cannot simply go back one menu using the back key. For example, if I go to Settings->Battery Manager->Battery Profile Options and want to go back to the Settings screen, I cannot.
Pushing the back button does nothing and I can only go back to the Settings menu by going Home, then re-entering.
Another quirk regarding the back button is when reading emails. Using a regular email account such as Hotmail, I cannot simply read an email and go back to the inbox using the button.
It makes navigating the phone very tedious.
View 5 Replies
View Related
Aug 4, 2010
I have a layout which has one large EditText view at the top + a bunch of buttons at the bottom. The EditText is made to shrink and expand when the ime is activated/deactivated by using adjust_resize. The buttons at the bottom are pushed up above the ime.
I would like to hide these buttons when the ime displays, to provide enough space for the EditText view.
I have so far tried the following:
subclassed EditText and provided the activity the option to register a callback on the view's OnSizeChanged.
Used this callback to change the visibility of the buttons (actually the layout container) to GONE.
This work OK and does hide the buttons when the ime pops up. However, the EditText does not expand into the new available space. Furthermore, when the ime is disposed off, the EditText field is now bigger than it was originally, pushing (the now showing) buttons outside the screen.
I should also add that when typing the first letter into the view, and the ime displays the word options, the screen is redrawn and the EditText fills the vacant space. how to get this to work? Or even better, is there a simpler solution to my requirement? In my view, scrolling is not a good option.
View 2 Replies
View Related
Nov 12, 2010
I have an EditText control that does not pop up the soft keyboard when the user touches it. The thing is, that I have a number of other EditText controls elsewhere in my application that all work fine, and I cannot see anything really different about this one.The code is a bit complex to post here, but I was wondering if anyone knows of any reasons why the soft keyboard would not appear in some cases.
View 3 Replies
View Related
Mar 29, 2010
I am interesting in integrating an arabic keyboard to the android system. I proceeded as follows: I have modified the xml and the layout in the package softkeyboard by replacing English letters and their codes by the arabic one.Of cource I created 2 new directories in softkeyboard: xml-ar and layout-ar After rebuilding the system , I don't find the new softkeyboard.
View 4 Replies
View Related
Jun 24, 2010
I have One AutocompleTextView and I want to make the virtual keyboard disappear when he hits "DONE" at the AutocompleTextView. So far, the buttons "NEXT"/"DONE" do nothing at all Unfortunately I found no resources addressing this problem.
View 1 Replies
View Related
Jun 28, 2010
I've got a problem with my application in that the soft-keyboard is not being closed unless the user pushes the "back" button.I use several layouts which I load using the setContentView method of the application. Some layouts contain multiple EditText fields. The soft-keyboard pops up correctly when the entry boxes are being clicked, but never gets dismissed, even after I switch to a new layout using setContentView (instigated by on-screen push buttons).I found a way of apparently removing the keyboard using the "InputManager" class but how exactly does that work if I don't know which entry field opened/currently owns the keyboard?Is there a way of possibly invalidating a whole layout which would perhaps cause all resources (and hopefully the keyboard) to be cleared? As said before, I currently just use setContentView to load the next screen.
View 4 Replies
View Related
Jan 25, 2010
How can I select what soft-keyboard an edittext will load?
View 3 Replies
View Related
Jun 24, 2010
if application has EditText widget and user clicks on it, a qwertysoft keyboard appears. how do you get a numeric, 12key, or phone soft keyboard to appear instead. (I have searched documentation but I cannot find solution.)
View 2 Replies
View Related
Oct 20, 2009
How can I set numeric-only soft keyboard option for a text field? When I set the input-type to "number" it brings a soft keyboard which is actually a alpha-numeric one but already switched to numeric mode. What I want is a pure numeric soft keyboard with big numbers (no alphabets at all). I've already seen this in other applications and but don't know how to do it.
View 6 Replies
View Related
Apr 24, 2009
I have a form that is working fine with the "Next" flow order when using the computer keyboard with emulator (and probably with the keyboard on the G1) but not with the SoftKeyboard with 1.5.Some fields indicate "Next" with this keyboard, some go to the correct field and others don't.Two of the fields are text and they only give a carriage return instead of "Next."My numeric fields give the proper "Next" key. Use of the SoftKeyboard is a little underdocumented so far (if there is a hidden doc online somewhere please provide me a link to it). There are also some added fields under 1.5 that I have asked about previously but received no answer.These appear to have something to do with the Soft Keyboard.Though these can be set programmatically I haven't seen the proper way to set these flags using XML. This field is the one that replaces "Numeric" which deprecated.
View 3 Replies
View Related
Jul 13, 2010
So Sony appears to have included their own IME with their xperia phones.I have an edit box for numerical input that i have specified as number numberDecimal|phone It allows for easy number entry and allows users to enter in decimal numbers.However the IME in the xperia phones is missing the decimal key. Is there a way to specify it should only be using the android IME?Can I specify resources for specific phones similar to how I can control resources for versions of android?
View 9 Replies
View Related
May 10, 2009
is there a way to enforce the soft keyboard throughout the lifetime of an Activity? I tried setting stateAlwaysVisible in the Manifest.xml as well as the counterpart.
View 6 Replies
View Related
May 29, 2009
This is probably very easy but I just don't know how to close the Soft Keyboard after user hits "search" key on the soft keyboard.Could someone help me out?Currently my code listens for key press particularly enter or the search key.
View 5 Replies
View Related
Apr 29, 2009
How do i disable the SoftKeyboard?
View 3 Replies
View Related