-3

I created a little app that has a search bar. now I want to know if I can handle the situation when a user press the Enter key. so the app can call the buttonOnClickListener() that actually perform the search?

udondan
  • 52,841
  • 19
  • 186
  • 168
Pedro Teran
  • 1,180
  • 2
  • 17
  • 42

1 Answers1

1

for handling you Search button on keyboard, you can refer here.

Android - Handle “Enter” in an EditText

and for performing the same action as buttonOnClickListener(View) do something like this:

yourSearchButton.performClick();
Community
  • 1
  • 1
Adil Soomro
  • 37,173
  • 9
  • 101
  • 148