Set input method option with imeOptions
Description
The following code shows how to Set input method option with imeOptions.
Example
Main layout activity_main.xml file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<EditText
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:imeOptions="actionSearch"
/>
<EditText
android:id="@+id/text2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:imeOptions="actionGo"
/>
</LinearLayout>
Main activity Java code
package com.java2s.myapplication3.app;
/* w ww .j a va 2 s.c o m*/
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}