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 7977095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:05:45+00:00 2026-06-04T09:05:45+00:00

Hello Android developers, I’ve got a problem with the Android SearchView widget. What I’m

  • 0

Hello Android developers,

I’ve got a problem with the Android SearchView widget. What I’m trying to do is to attach a “live” text filter to my ListView (text input automatically refreshes filter results). It works actually fine and it was no huge effort to get it working on my ListActivity with these lines:

private SearchView listFilter;

this.listFilter = (SearchView) findViewById(R.id.listFilter);
this.listFilter.setOnQueryTextListener(this);
this.listFilter.setSubmitButtonEnabled(false);

this.getListView().setOnItemClickListener(this);
this.getListView().setTextFilterEnabled(true);

// from OnQueryTextListener
public boolean onQueryTextChange(String newText) {
    if (newText.isEmpty()) {
        this.getListView().clearTextFilter();
    } else {
        this.getListView().setFilterText(newText);
    }
    return true;
}

And here the xml widget declaration

<SearchView
    android:id="@+id/listFilter"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:iconifiedByDefault="false"
    android:queryHint="enter text to filter" />

Now what my problem is that every time I enter text into the SearchView, a strange text field pops up instantly showing the same text as I just entered which is kind of useless since I can see my input in the SearchView itself and it partly blocks the sight on my list entries, which is just annoying.

Is there any way to prevent that text field from popping up on typing into the SearchView? I couldn’t find any property neither on the xml defined widget options nor on the java class reference.

I know there is another way to provide the filter functionality by using EditText and TextWatcher, but then I have to handle the filtering all by myself and couldn’t profit from the SearchView handling it for me.

Any suggestions are appreciated.
Best regards

Felix

  • 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-04T09:05:47+00:00Added an answer on June 4, 2026 at 9:05 am

    i found out how to get rid of that ugly popup window. The trick is to work with filter directly.The code below assumes you have implemented filterable in your customAdapter.

    public boolean onQueryTextChange(String newText) {
        if (TextUtils.isEmpty(newText)) {
           m_listView.clearTextFilter();
        } else {
           ContactsAdapter ca = (ContactsAdapter)lv.getAdapter();
           ca.getFilter().filter(newText);
           //following line was causing the ugly popup window.
           //m_listView.setFilterText(newText);
        }
       return true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I completed the tutoriel at this site, http://developer.android.com/resources/tutorials/views/hello-listview.html My problem is that I
Hello fellow developers, I am trying to achieve something in Android and I would
I have completed the Hello Views tutorial from android developers (http://developer.android.com/resources/tutorials/views/hello-listview.html) I understood the
I am follow google's listview tutorial (http://developer.android.com/resources/tutorials/views/hello-listview.html) and I'm trying to ad an adview
I'm trying to get the maps api tutorial in the documentation ( http://developer.android.com/resources/tutorials/views/hello-mapview.html )
I am trying to modify this example: http://developer.android.com/resources/tutorials/views/hello-gridview.html But instead of displaying images that
I'm trying to make work this example from http://developer.android.com/resources/tutorials/views/hello-timepicker.html , no errors while compiling
I'm trying to get into Android app developing. My first problem is actually getting
I'm currently trying out the google's various android examples at http://developer.android.com/guide/tutorials/views/hello-spinner.html BUT I can't
Hello android developers, I was struggling to get this work but failed and now

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.