SearchView is not responding in android
<p>I want to implement searching in my application using SearchView .I am following  <a href="http://developer.android.com/guide/topics/search/search-dialog.html" rel="nofollow noreferrer">this</a> tutorial.</p>

<p>I am having an activity which contains 3 tabs .On the toolbar ,i want to use searching .Screenshot is given below :</p>

<p><a href="https://i.stack.imgur.com/XRVWb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XRVWb.png" alt="Screenshot"></a></p>

<p>I have successfully added three tabs in my activity.Now to implement SearchView ,i am using the following code in my Activity:</p>

<pre><code> @Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.menu.menu_friend_list_activity, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_search:
            Toast.makeText(getApplicationContext(), "Search button clicked", Toast.LENGTH_SHORT).show();

            // Associate searchable configuration with the SearchView
            SearchManager searchManager = (SearchManager) FriendsListActivity.this.getSystemService(Context.SEARCH_SERVICE);
            if (item != null) {
                searchView = (SearchView) item.getActionView();
            }
            if (searchView != null) {
                searchView.setSearchableInfo(searchManager.getSearchableInfo(FriendsListActivity.this.getComponentName()));
            }
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }

}
</code></pre>

<p><strong>menu_friend_list_activity.java</strong></p>

<pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
    &lt;item
        android:id="@+id/action_search"
        android:icon="@drawable/search"
        android:orderInCategory="100"
        android:title="@string/action_search"
        app:actionViewClass="android.support.v7.widget.SearchView"
        app:showAsAction="always|collapseActionView" /&gt;
&lt;/menu&gt;
</code></pre>

<p><strong>searchable.xml under res/xml folder</strong></p>

<pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;searchable xmlns:android="http://schemas.android.com/apk/res/android"
    android:hint="@string/search_hint"
    android:label="@string/app_name" /&gt;
</code></pre>

<p><strong>SearchResultActivity.java</strong></p>

<pre><code>public class SearchResultsActivity extends Activity {
@SuppressLint("MissingSuperCall")
@Override
public void onCreate(Bundle savedInstanceState) {
    handleIntent(getIntent());
}

@Override
protected void onNewIntent(Intent intent) {
    handleIntent(intent);
}

private void handleIntent(Intent intent) {
    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
        String query = intent.getStringExtra(SearchManager.QUERY);
        Log.e("Query",query);
        //use the query to search your data somehow
    }
}
</code></pre>

<p><strong>AndroidManifest.xml</strong></p>

<pre><code> &lt;activity
            android:name=".activity.FriendsListActivity"
            android:parentActivityName=".activity.WelcomeActivity"&gt;
            &lt;!-- To display the search view--&gt;
            &lt;meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" /&gt;
        &lt;/activity&gt;
        &lt;activity android:name=".activity.SearchResultsActivity"&gt;
            &lt;intent-filter&gt;
                &lt;action
                    android:name="android.intent.action.SEARCH"
                    android:launchMode="singleTop" /&gt;
            &lt;/intent-filter&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.VIEW" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
</code></pre>

<p>On clicking the search icon ,Search view is displayed .But on entering the text,it should display the string entered in handleIntent() method.I am not able to receive ,what i am entering in search view.I might be possible that i am doing something wrong here.Please help me understand the working of SearchView.</p>