views:

31

answers:

1

I'm attempting to replicate on android an iphone app my company had developed externally.

My need is simple but it seems hard to achieve under android. I have three numeric edittext inputs. Each should take only decimal numeric values. So numbers 0-9 and "." or ",". On the iphone this was achieved by a slide in calculator style keypad with one of the buttons a "GO" button that when pressed hides the keypad and, if all the inputs have valid values triggers a calculation that displays values on the screen.

I've tried the android phone input type and this is very close to what I want but I have no idea how to replicate the go button. I have put a calculate button on the main interface itself but I can't get the keyboard to go again once it is opened.

So can I either

A. Modify the layout of the phone keypad in some way to change one of the buttons to be GO (Calculate) and intercept the keypress or

B. Do I have to create my own keypad in which case how do I go about sliding it in and out over the top of the current view?

thanks guys

A: 

See android:imeActionId and android:imeActionLabel for your GO button.

CommonsWare
Ok thanks that's somewhere to start. Is this covered in any of your books?
Dream Architect
@Dream Architect: Not much, unfortunately. I'll work on an example and add it to _The Busy Coder's Guide to Android Development_ later this year. I have only used this feature once myself, and that was on a consulting gig, so I don't have source code to share with you.
CommonsWare
@Dream Architect: If you're a subscriber, what coverage I do have in _The Busy Coder's Guide to Android Development_ is on pages 161-2 of Version 3.1 of that book. As I recalled, it's weak -- my apologies.
CommonsWare
I'm not a subscriber yet but this has reminded me it was on my todo list. I've found out a bit about imeactionid online and now I understand why you say thats the way to go. I'll look at subscribing later on today. Thanks again for your help
Dream Architect