Thanks for that tip, the android:numeric attribute must have just passed me
by. I much prefer defining input constraints declaratively where I can.
Tom.

2009/4/30 Peli <peli0...@googlemail.com>

>
> I achieved backward compatibility with the following attribute:
> android:numeric="integer"
>
> The soft keyboard opens just fine, with the digits in the top row.
>
> Peli
> www.openintents.org
>
> On Apr 30, 12:47 pm, Tom Gibara <m...@tomgibara.com> wrote:
> > The problem is that android:inputType was introduced in 1.5 and is
> > off-limits for application that need to retain compatibility with 1.1
> during
> > transition in the existing user base.
> > My workaround was to attach the digits listener in code and not through
> the
> > XML, like so:
> >
> > mPin.setKeyListener(new DigitsKeyListener.getInstance());
> >
> > These also work:
> >
> > mPin.setKeyListener(DigitsKeyListener.getInstance("0123456789"));
> > mPin.setKeyListener(new DigitsKeyListener(false, false));
> >
> > whereas this does not:
> >
> > android:digits="0123456789"
> >
> > I didn't have time when I first posted, but I just read the source code
> and
> > the cause of the bug is probably related to work done in the TextView
> > constructor, in particular the suspicious looking second line below:
> >
> >   mInput = DigitsKeyListener.getInstance(digits.toString());
> >   mInputType = inputType;
> >
> > comparing that to the work done when you explicitly set a KeyListener it
> > looks like something's missing.
> >
> > Tom.
> >
> > 2009/4/30 Simon <simon.drab...@gmail.com>
> >
> >
> >
> > > Pretty sure adding
> >
> > > android:inputType="number"
> >
> > > will fix your issue. You may also need to add:
> >
> > > android:windowSoftInputMode="stateVisible|adjustResize"
> >
> > > as an attribute of the activity section of AndroidManifest.xml
> >
> > > -- Simon
> >
> > > On Apr 27, 11:37 pm, Tom Gibara <m...@tomgibara.com> wrote:
> > > > I just tried this in the 1.5 r1 release and it remains
> non-functional, so
> > > > I'm assuming it's a bug:
> > >http://code.google.com/p/android/issues/detail?id=2525
> >
> > > > Tom.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to