Q:

How to make center the hint of searchView in android?

Can anyone tell how make Search View hint in centre? Thanks in advance.

A:

To center the hint on the SearchView you need to center the gravity in the EditText contained in the SearchView.
You can find that specific view by using the Layout Inspector in Android Studio (Tools->Android->Layout Inspector). When you click on the search view in your UI, you can see it has a SearchView$SearchAutoComplete. That's an inner class in the SearchView which extends AutoCompleteTextView, which extends EditText. So, that's the view you want to change. Observe in the property-value pane of the Layout Inspector that the id is id/search_src_text so you can use that to get the view and center the gravity, like this:
int id = getResources().getIdentifier("android:id/search_src_text", null, null);
EditText searchEditText = (EditText) mSearchView.findViewById(id);
if (searchEditText != null) {
    searchEditText.setGravity(Gravity.CENTER);
}

Since the id of the EditText isn't officially documented, there's a null check in there just in case the id changes or isn't consistent everywhere. 

