Defaulting to numeric keyboard on EditText without forcing numeric input.

by Mike Olson » Fri, 07 Aug 2009 01:00:46 GMT

Sponsored Links
 I have an EditText that I don't want to force to be a number, but
chances are it almost always will start with a number (The field is
"Quantity", and I'd like to to be free text, so I can write "1 oz", "2
boxes", etc).

Is there a way to have the on-screen keyboard default to the numeric
keyboard, but still allow me to enter letters if I press the "ABC"
button?  If I say add android:number="integer" it won't allow non-
numeric inputs.



Other Threads

1. Direct access to GEARS geolocation without going through the browser interface


Thanks. I am aware of that. My question was different. Have you looked
into the GEARS geolocation class? If you have, you will have seen the
three Android Java classes I refer to below. My question is about the
purpose and intended use of those classes.

Given that Google has removed all of the MASF related functions from
the SDK, very few ways are left for accessing location information
starting from WIFI, GPS, or cell data. Fortunately, it appears that
the interface is still accessible (for
how long???). GEARS geolocation offers a way to derive location
information starting from GPS, WIFI, or radio information. However, it
would be incorrect to assume that access via a browser is optimal, or
appropriate for all applications.

The fact that geolocation includes Android-specific public Java
classes to access GPS, WIFI, and radio information leads me to believe
that, in fact, there is (should be) a way to directly access
geolocation functions from an Android application without going
through the browser.

If you are not familiar with this area, that's OK, just say so.


Alex Donnini


2. Setting Ringer From Resource?

Hopefully someone can point me in the right direction ...

In my application I want to set the ringtone to one of the resources
in my project. I have not got this to work, yet.

I'm setting the default ringer to a resource in my application with
the following code.

Uri mediaUri = Uri.parse("android.resource://
com.example.myapp/" + mediaId);
RingtoneManager.TYPE_RINGTONE, mediaUri);

I can play the resource via the RingtoneManager with this code:
RingtoneManager.getRingtone(getApplicationContext(), mediaUri).play();

This plays the sound I would expect.

However, if I ask the RingtoneManager to play the default ringer, it
plays the default android ringer.
Here is the code I'm using to play the default ringer:

Uri defaultUri = RingtoneManager.getDefaultUri
Ringtone rt = RingtoneManager.getRingtone(getApplicationContext(),

The question is...
Why is the "setActualDefaultRingtoneUri" method call not setting the
default ringer?

What am I doing wrong? I've searched many user forums, read the docs,
and all the news groups and I cant seem to find what I'm doing wrong.



3. How to make a Draggable Menu

4. What is the problem with my android: Unable to extract+optimize DEX from '/system/framework/ext.jar'

5. Failed to launch the android under the emu

6. getDeviceId returns null

7. Do i need to release the static variable and remove the listener when the app is closed?