Keep different search histories for different activities?
<p>I have two activities, and I'd like them to each maintain their own search history suggestions. Is that possible? They each have their own search suggestion provider, but I see the same search history appearing for both activities:</p>

<pre><code>// mannifest.xml
&lt;activity
  android:name="ActivityA"
  ...
  &lt;meta-data 
    android:name="android.app.searchable"
    android:resource="@xml/searchable_A" /&gt;
&lt;/activity&gt;

&lt;activity
  android:name="ActivityB"
  ...
  &lt;meta-data 
    android:name="android.app.searchable"
    android:resource="@xml/searchable_B" /&gt;
&lt;/activity&gt;


// searchable_A.xml
&lt;searchable   
  android:searchSuggestAuthority="providerA" /&gt;

// searchable_B.xml
&lt;searchable   
  android:searchSuggestAuthority="providerB" /&gt;
</code></pre>

<p>When saving the search suggestions, I'm making sure to use the correct provider for each activity.</p>

<pre><code>// ActivityA.java
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(ActivityA.this,
    providerA.AUTHORITY, providerA.MODE);
suggestions.saveRecentQuery(...);

// ActivityB.java
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(ActivityB.this,
    providerB.AUTHORITY, providerB.MODE);
suggestions.saveRecentQuery(...);
</code></pre>

<p>Since the search suggestion providers are different, I was expecting them to each maintain a different history. The use case here is that I have an activity dedicated to cars, and an activity dedicated to foods. I don't want past search terms to be mixed together, they don't make sense in the different contexts.</p>

<p><a href="http://developer.android.com/guide/topics/search/adding-recent-query-suggestions.html" rel="nofollow">http://developer.android.com/guide/topics/search/adding-recent-query-suggestions.html</a></p>

<p>Thanks</p>
