Question

I'm trying to convert an EditText to a AutoCompleteTextView. There is another EditText on the same page. When I had two EditText controls, the keyboard would say "Next" while the entry was going on for the fist one and then say "done" for the second one.

After converting the first EditText to an AutoCompleteTextView, the Next button would not skip down to what used to be the second EditText. After looking around for a solution I found that if I added the following...

android:imeOptions="actionNext"

That would solve my problem and it did cause the cursor to skip down to the EditText BUT now my onKey event does not get executed!!

public boolean onKey(View v, int keyCode, KeyEvent event)

So, the imeOptions solution causes worst behavior. I want the Next key to obviously trigger the onKey event and also migrate the cursor to the EditText field.

Actually, I would be happy for the keyboard to just have a "Done" key on the AutoCompleteTextView because I never liked the "Next" thing anyway. Is there anyway of just doing away with this whold Next metaphor and just having the keyboard always say "Done" for all the entry fields on a page? Thanks, Gary

Was it helpful?

Solution

It looks like onKeyListener works ok as long as imeOptions is not used. If imeOptions is used then onKeyListener no longer works - you need to use OnEditorAction. What a mess.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top