[android] How to hide Soft Keyboard when activity starts

Try this.

First in your searchable xml the fields (name and hint etc) put @string and not literal strings.

Then method onCreateOptionsMenu, it must have a ComponentName object with your package name and your completed class name (with package name) - In case activity which has the SearchView component is the same as the show search results use getComponentName(), as the google android developer says.

I tried a lot of solutions and after much,much work this solution works for me.