ERJAN
ERJAN

Reputation: 24500

How do I automatically remove focus from searchview in android app after clicking on it

I m making book finder app. step1: i clicked on search button and activity is waiting for my book title

k

step2: i input some book title k2

k3

step3: the focus still stays on this search button, i have to click on screen to make it go away.

is there way to automatically loose focus on last widget i clicked on?

Upvotes: 1

Views: 1621

Answers (1)

Ashton Engberg
Ashton Engberg

Reputation: 6109

You probably just want to call requestFocus() on your book list whenever a search completes (however, if there are no results, you may want to re-open your search box, or do so after a delay). There is also a OnFocusChangedListener which might be of help if requesting focus on your list after serving up results does't work for some reason.

Upvotes: 2

Related Questions