Skip to content

Instantly share code, notes, and snippets.

@yozawiratama
Last active December 19, 2015 01:09
Show Gist options
  • Save yozawiratama/5873928 to your computer and use it in GitHub Desktop.
Save yozawiratama/5873928 to your computer and use it in GitHub Desktop.
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
performSearch();
return true;
}
return false;
}
});
<EditText
android:imeoptions="actionSearch"
android:layout_height="50dip"
android:layout_width="match_parent"
android:textcolor="@color/card_text_light"
android:textsize="14sp"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment