Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3963512
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:13:27+00:00 2026-05-20T03:13:27+00:00

I have two different Search activities implemented with SearchManager in my app. One is

  • 0

I have two different Search activities implemented with SearchManager in my app. One is the default searchable for the whole app and the other is used for only one activity. These two searches perform lookups of different data, and it doesn’t make sense to share the search history across the two different searches. The two different searchables are working fine functionally within the app, my issue is with the recent search histories.

The problem is that there are two different SearchRecentSuggestionsProvider classes defined within the app, but any search made in one shows up in both searches’ recent search suggestions history. I’ve read through the SearchManager topic in the Dev Guide but don’t see any info about multiple suggestions providers.

Here are the two providers in the AndroidManifest.xml, in the node:

<provider android:name=".SearchOneRecentSuggestionsProvider"
 android:authorities="com.company.SearchOneRecentSuggestionsProvider"></provider>
<provider android:name=".SearchTwoRecentSuggestionsProvider"
    android:authorities="com.company.SearchTwoRecentSuggestionsProvider"></provider>

Here’s the class defined in SearchOneRecentSuggestionsProvider.java:

package com.company;

import android.content.SearchRecentSuggestionsProvider;

public class SearchOneRecentSuggestionsProvider extends SearchRecentSuggestionsProvider {
     public final static String AUTHORITY = "com.company.SearchOneRecentSuggestionsProvider";
     public final static int MODE = DATABASE_MODE_QUERIES;

     public SearchOneRecentSuggestionsProvider() {
      setupSuggestions(AUTHORITY, MODE);
     }
    }

(The SearchTwoRecentSuggestionsProvider class looks exactly the same except for replacing One with Two and is in it’s own SearchTwoRecentSuggestionsProvider.java file.)

Here’s what is inside the search suggestions database (at /data/data/com.company/databases/suggestions.db):

# sqlite3 suggestions.db
SQLite version 3.5.9
Enter ".help" for instructions
sqlite> .tables
android_metadata  suggestions
sqlite> .schema suggestions
CREATE TABLE suggestions (_id INTEGER PRIMARY KEY,display1 TEXT UNIQUE ON CONFLICT REPLACE,query TEXT,date LONG);
sqlite> select * from suggestions;
1|searchone|searchone|1296177852444
2|searchtwo|searchtwo|1296177878744

There’s no column for the SearchRecentSuggestionsProvider, so perhaps there’s no way to separate the history for the two searches?

The end result of all this is that when you do a search in either one of the two different searches, you see both searchone and searchtwo in the recent search history suggestions. I’d like each to have their own history if possible. Hopefully I didn’t just miss something silly! Thanks for taking the time to read this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:13:27+00:00Added an answer on May 20, 2026 at 3:13 am

    Looks like it’s not possible at this time. For those of you searching SO for this same issue, see https://code.google.com/p/android/issues/detail?id=13501 for future updates from Google.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So let's say I have two different functions. One is a part of the
I have two completely different forms in one template. How to process them in
I have two different Rails application speaking with each other through API calls. Gone
I have two different ways of displaying items in a WPF application. The first
I have two different grid controls on the same form. They share the same
I have two XML files with two different XSD schemas and different namespaces. They
I have two classes A and B in two different .NET assemblies: AssemblyA and
Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue. Why do we have two?
I have two insert statements, almost exactly the same, which run in two different
I have been given two different Microsoft Word document that my virus scanner has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.