Tobias Moe Thorstensen
Tobias Moe Thorstensen

Reputation: 8981

Customize the InputType in EditText android

I have an EditText field in my layout, with the android:inputType="number". The thing that bothers me is that in the bottom right corner, there is a button saying next, is it possible to customize this to have an Done button here instead which will trigger the keyboard to "go away"?

enter image description here

Upvotes: 0

Views: 1934

Answers (4)

user1087919
user1087919

Reputation:

Use following code

editText.setImeOptions(EditorInfo.IME_ACTION_DONE);

or android:imeOptions in xml file

Upvotes: 0

AITAALI_ABDERRAHMANE
AITAALI_ABDERRAHMANE

Reputation: 2519

in your xml file put android:imeOptions="actionDone" to EditText

Upvotes: 3

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132992

You need to set the android:imeOptions attribute equal to actionDone for Relative EditText as:

<EditText 
    android:id="@+id/edittxt_done"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="Enter text"
    android:imeOptions="actionDone"
    />

Upvotes: 1

user370305
user370305

Reputation: 109257

In your EditText properties set android:imeOptions attribute

android:imeOptions="actionDone"

Upvotes: 2

Related Questions