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

  • SEARCH
  • Home
  • 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 8086943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:36:25+00:00 2026-06-05T18:36:25+00:00

I have a search function in my project. In the searchable.xml, i would like

  • 0

I have a search function in my project. In the searchable.xml, i would like to limit the search only when user types at least 3 characters.

This can be done with android:searchSuggestThreshold=”3″ but in my case, nothing happens, the user can still perform a search when he types on or more characters.

Here is my searchable.xml:

<searchable xmlns:android="http://schemas.android.com/apk/res/android"
    android:label="@string/Label"
    android:hint="@string/Hint"
    android:searchSuggestThreshold="3"
    android:includeInGlobalSearch="true"/>

Here is the 2 search activityes from the Manifest

 <activity android:name=".Search"
        android:configChanges="orientation|keyboardHidden">
          <intent-filter>   
        <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
               android:resource="@xml/searchable"/>   
        </activity>

         <activity android:name=".SearchInterface"
        android:configChanges="orientation|keyboardHidden">
         <meta-data android:name="android.app.default_searchable"
               android:value=".Search" />
         </activity>
  • 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-06-05T18:36:28+00:00Added an answer on June 5, 2026 at 6:36 pm

    Before answer your question there is one thing you have to change in the AndroidManifest.

     <meta-data android:name="android.app.default_searchable"
                   android:value=".Search" />
    

    have to be between <application></application> tags but not inside <activity></activity> ones. Because it declares the default activity to call when a Search intent is fired.
    After that try if the android:searchSuggestThreshold now works. What you can do as a workaround is in the SearchHelper you are using (the class that manage sql queries) you recieve the search input from the user as the parameter so you can put a simple if. Like this:

    public static Cursor getAutoCompleteCursor(String s) {
        Cursor cursor;
        if (s != null && s.length() > 2)
            cursor = searchAutoComplete(s);
        else
            cursor = null;
        return cursor;
    }
    

    I hope you understand what I mean. Any doubt just let me know!

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

Sidebar

Related Questions

I have a similar code snippet like this class Search { public function search($for,
hai I have a magento web site. In this the search function compare with
I have code like this: function search_keyword(){ $keyword = $this->db->escape_like_str(trim($_POST['keyword'])); $sql = ( SELECT
I have code like this: function search_keyword(){ $keyword = trim($_POST['keyword']); $search_explode = explode( ,
I have code like this: function search_keyword(){ $keyword = trim($_POST['keyword']); $search_explode = explode( ,
Okay this is part of my search results project, in it, I have description
I have a search function in which i am returning all the records of
I have a binary search function that will search for a word in an
I have an active directory search function: Function GetAdInfo(ByVal ADDN As String, ByVal ADCommonName
How can i have slide downeffect? The effect will be similar with search function

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.