Implementing Search Functionality on Text Change in Android
<p>I am trying to Implement the Search Functionality in my Android Application using the link <a href="http://developer.android.com/guide/topics/search/search-dialog.html" rel="nofollow">http://developer.android.com/guide/topics/search/search-dialog.html</a>.</p>

<p>It can only search the text entered when pressed on the search button. But it cannot perform search when the text in the search bar changes. I want to implement that kind of functionality, just as it is in the "People" or "Contact" App in the Android phones.</p>

<p>I have tried to search for this a lot but unable to find any links. If anyone can direct my to those links, it would be useful. Thanks in advance.</p>

<p>Edit:</p>

<p>I have implemented the search functionality in the MainActivity Only. The code for MainActivity.java:</p>

<pre><code>findViewById(R.id.id1).setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        onSearchRequested();
    }
});
</code></pre>

<p>Android Manifest:</p>

<pre><code>&lt;activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:launchMode="singleTop"&gt;
    &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.MAIN" /&gt;
        &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;action android:name="android.intent.action.SEARCH" /&gt;
        &lt;action android:name="android.intent.action.VIEW" /&gt;
    &lt;/intent-filter&gt;
    &lt;meta-data
        android:name="android.app.searchable"
        android:resource="@xml/activity_search" /&gt;
&lt;/activity&gt;
</code></pre>