Start Different Keyboard for different activities
My application has two requirements where one screen is an numeric entry and other has an search option. Since user has to use the numeric keyboard most of the time he has to change the input type of edit text and select the keyboard. Is there开发者_StackOverflow中文版 any way i could start a numeric keyboard for one activity and charater keyboard when other activty starts
Sebs
hiii,,,
Use for the edit text that should open a numeric keypad with following property:
android:inputType="phone"
And android:imeOptions="actionSearch"
for other activity Edit Text xml layout
Hope you would be able to get what I mean to convey
With Regards,
Arpit Garg
To just get a numeric keyboard the user should not have to longpress and choose input type. That would be only if they are trying to change which actual keyboard application they are using, for instance switching from Android Keyboard to Swype keyboard. All of the different configurations of keys are all part of each keyboard separately. So the Android keyboard contains a qwerty keyboard, a number keyboard (which has numbers across the top row and symbols on all the other keys) and a Number pad keyboard (9x9 block of numbers like the numpad on your PC, or an old telephone). To tell the system which you'd like to use you just have to specify the inputType for your EditText.
this page will show you possible types
this question will show you how to set it from xml
精彩评论