Android :: Soft Keyboard Key Fails In EditText On Gallery Widget

Jun 4, 2010

I am developing an application in Eclipse build ID 20090920-1017 using android SDK 2.2 and testing on a Google Nexus One. For the purposes of the tests below I am using the IME "Android keyboard" on a non-rooted phone.I have an EditText widget which exhibits some very strange behavior. I can type text, and then press the "del" key to delete that text; but after I enter a 'space' character, the "del" key will no longer remove characters before that space character.An example speaks a thousand words, so consider the following two incredibly simple applications.Example 1: An EditText in a LinearLayout widget:
package com.example.linear.edit;
import android.app.Activity;
import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;
import android.widget.EditText;
import android.widget.Gallery;
import android.widget.LinearLayout;
public class LinearEdit extends Activity
@Override
public void onCreate(Bundle savedInstanceState)
{super.onCreate(savedInstanceState);
LinearLayout layout = new LinearLayout(getApplicationContext());
layout.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.MATCH_PARENT, Gallery.LayoutParams.MATCH_PARENT));
EditText edit = new EditText(getApplicationContext());
layout.addView(edit, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
setContentView(layout);
}Run the above application, enter text "edit example", then press the "del" key several times until the entire sentence is deleted. Everything Works fine.Now consider example 2: An EditText in a Gallery widget:
package com.example.gallery.edit;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Gallery;
import android.widget.LinearLayout;
public class GalleryEdit extends Activity
{ private final String[] galleryData = {"string1", "string2", "string3"};
@Override
public void onCreate(Bundle savedInstanceState)
{super.onCreate(savedInstanceState);
Gallery gallery = new Gallery(getApplicationContext());
gallery.setAdapter(new ArrayAdapter(getApplicationContext(), android.R.layout.simple_list_item_1, galleryData)
@Override
public View getView(int position, View convertView, ViewGroup parent)
{LinearLayout layout = new LinearLayout(getApplicationContext());
layout.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.MATCH_PARENT, Gallery.LayoutParams.MATCH_PARENT));
EditText edit = new EditText(getApplicationContext());
layout.addView(edit, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); return layout; setContentView(gallery);
}Run the above application, enter text "edit example", then press the "del" key several times. If you are getting the same problem as me then you will find that you can't deleted past the 'space' character. All is not well.If anyone could shed some light on this issue I would be most appreciative.

Android :: Soft keyboard key fails in EditText on Gallery widget


Android :: Multiple EditText Not Getting Focus - No Soft Keyboard?

Sep 2, 2009

The home screen of my Android application has three EditText views, meant to be used as three different search functions, each with a "Search" button. The app works perfectly on the device (G1) when using the trackball: I can move between the EditTexts with the trackball, all the events fire as expected, I can enter text using the physical keyboard in the selected EditText, Enter correctly submits the proper search, etc.

However, I can't switch between the EditText views using touches - only by using the trackball. Touches seem to be completely ignored by the EditText. Touches do fire for the buttons, but very hard - takes a lot of tries to make a touch register. In the simulator, clicking on any EditText does nothing - the first one always remains selected, and I never get a soft keyboard. This is all inside a TabHost - I've read there are some problems with that configuration, but it sounds like a slightly different issue (the EditText doesn't seem to lose focus - everything works perfectly with the trackball).

View 2 Replies View Related

Android :: Soft Keyboard Covers Edittext Field

Jul 21, 2010

Is there a way to make the screen scroll to allow the text field to be scene?

View 3 Replies View Related

Android :: Trigger The Soft Keyboard For EditText In Dialogs

Nov 18, 2009

I am rendering an EditText as one element of a list-style AlertDialog (which is backed by the default ListView implementation). I sort of expected that this circumstance would not change the behavior of EditText, but it does: a click on the EditText does not spawn the soft keyboard anymore.

After an hour of messing around with focus settings and click handlers I got fed up and debugged into InputMethodManager.showSoftInput(), and found this:

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

The problem here is that mServedView is the ListView that's backing the dialog, while view is the EditText, and ListView.checkInputConnectionProxy() does simply return false in the default implementation of ListView (to be overridden by subclasses).

Worse, I couldn't find a way to set a custom ListView which allows proxying IME reuqests; AlertDialog.Builder.setView() accepts a custom ListView, but this is not the ListView that InputMethodManager sees.

View 2 Replies View Related

Android :: Disable Soft Keyboard For EditText Control In Sdk1.1

Oct 14, 2009

I'm using sdk1.1, there is no setInputType in InputMethodManager.

View 3 Replies View Related

Android :: Show Soft Keyboard Automatically When Focus On EditText

Mar 8, 2010

I'm showing an input box using AlertDialog. The EditText inside the dialog itself is automatically focused when I call AlertDialog.show(), but the soft keyboard is not automatically shown. How do I make the soft keyboard automatically show when the dialog is shown? (and there is no physical/hardware keyboard). Similar to how when I press the Search button to invoke the global search, the soft keyboard is automatically shown.

View 2 Replies View Related

Android :: Android - EditText And Button - When Click Button - Unfocus EditText And Hide Soft Keyboard

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

Android :: Want To Get EditText Data / When User Clicks On Soft Keyboard Enter Key

Oct 15, 2010

I want to get EditText data when user clicks on the soft keyboard Enter key.

View 3 Replies View Related

Android :: Configure An EditText's Soft Keyboard To Use Numbers Initially - But Still Allow Text

Jul 21, 2010

I want to let users input a postal code to my app. The common use case is the US zip code, which are composed solely of numbers, so I'd like to display the numeric keyboard initially in the soft input. However, not all postal codes are solely digits, so I still need users to be able to enter other characters.

I've been trying to do this with android:inputType, but by setting the "number" flag, it automatically blocks any input except for number-based stuff. Is there a way to just accept general text, but get the soft keyboard to initially display a more number-based keyboard?

View 1 Replies View Related

Android :: Catch Event That Soft Keyboard Shown / Hidden For EditText?

Sep 25, 2010

Is it possible to catch the event that Soft Keyboard was shown or hidden for EditText?

View 2 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 :: Use "+" From Soft Keyboard To Increase Value In An EditText?

Jul 20, 2010

I have an application in which I'm using an EditText to enter numbers. Howwever, I need to inlucde another option where the user can use the "+" and "-" to increase/decrease the value entered in the EditText. Is that possible?

View 3 Replies View Related

Android :: Duplicating Fling Motion Of Gallery Widget To Other Gallery Widget In Same Screen

Feb 17, 2010

I have two gallery widgets in same screen. If user flings on top gallery widget I would like to replicate the same fling motion on the other gallery widget thats beneath the first one. Is there a way I can possibly achieve this.

View 2 Replies View Related

Android :: Populate EditText Widget Text From Another EditText Widget Text

Jan 6, 2010

I am trying to populate the text of a second EditText widget with the text from the first EditText widget only when the second EditText widget receives focus, the second widget is not empty, and the first widget is not empty. When I run it and click into the second widget it does not populate. When I remove the third constraint ('etxt.getText ().toString().trim() == ""')) it works. so getText() on the second EditText widget is returning something even though the second widget has no initial value other then the text that is displayed via the hint attribute.

View 2 Replies View Related

Android :: How To Develop A Soft Keyboard - HTTP Connections To Synchronize Keyboard Data With A Cloud DB And Other Phones

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

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

General :: MK802 Mini PC - Disable Soft Keyboard Hiding With USB Keyboard Available?

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

Android :: Passing Touch Events From One Gallery Widget To Another Widget

Feb 18, 2010

I am trying to pass the same touch events on one widget to the other so they both scroll at the same time and in same way. I have two Gallery widgets one above and one below. If the above one is scrolled then I want to pass the same touch event to the bottom widget so it also scrolls the same way.I have tried to use dispatchtouchevent events but I am facing an issue where in if the bottom gallery widget has some edit text then the edit text gets the key event and both widgets doesnt scroll anymore.I have tried to set focussable and editable to false on edittext even then it gets the touch events.I think I am going in the right direction. However I need some assistance in doing the right way.

View 3 Replies View Related

Android :: Android Soft Keyboard - Manipulate Views On Keyboard On - Off

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

Android :: Why Might Soft Keyboard Not Pop Up?

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

Android : How Can I Get Soft Keyboard?

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

Android :: Done Is Not Working In Soft Keyboard

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

Android :: Soft-keyboard Is Not Being Closed

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

Android :: How Can I Select What Soft-keyboard?

Jan 25, 2010

How can I select what soft-keyboard an edittext will load?

View 3 Replies View Related

Android :: How To Specify Which Soft Keyboard Appears?

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

Android :: Numeric-only Soft Keyboard

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

Android :: Next Focus And Soft Keyboard

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

Android :: Soft Keyboard Selection From App?

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

Android :: How To Enforce Soft Keyboard?

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

Android :: How To Close Soft Keyboard?

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







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