Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the keyboard to show a return key?

I think I've tried every combination, but I can't get the alpha keyboard to show the return key. It's always a "Done" button, which is not useful. On a Nexus 7 (4.1), it's worse, and shows a stupid smiley button along with the Done button, which makes no sense for my application. It's fine to have a Done button as long as I have a return button. Here's one of many options I've tried:

<AutoCompleteTextView
    android:id="@+id/annotate_edit"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="15dp"
    android:layout_marginLeft="60dp"
    android:layout_marginRight="60dp"
    android:layout_marginTop="15dp"
    android:completionThreshold="1"
    android:inputType="textCapSentences|textImeMultiLine"
    android:imeOptions="actionDone"
    android:lines="1"
    android:maxLength="18"
    android:textSize="30px" />

I've tried with and without the imeOpitons line, and various inputType options including removing it. There are options to make it a search button (not helpful), but nothing listed to make it a return key. I've also tried with "lines=2", which did not fix it. Any other ideas?

like image 645
Frank Avatar asked Oct 07 '22 06:10

Frank


1 Answers

Right now you have set imeOptions="actionDone". You say you've tried removing it, but all that does it default it to actionDone again, per the docs.

Try setting imeOptions="actionNone" instead. That should give you no action and force a return key.

I don't know that that by itself will guarantee a working multiline AutoCompleteTextView, however. I have one in an app, and it shows a return key on all my devices. The difference is the behaviour of the return key.

For instance, on my GNex (4.1), when you press return it line feeds properly.

On my SGS2 (2.3), nothing happens when you press it. No multiline, no completion. Just a dead button.

It could be the difference in the default EditText style in different APIs, so you should also try setting inputType="textMultiLine". There may be a subtle difference between that and textImeMultiLine.

like image 150
Geobits Avatar answered Oct 10 '22 02:10

Geobits