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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:11:39+00:00 2026-05-28T11:11:39+00:00

I want to implement search bar in my application which will filter list view

  • 0

I want to implement search bar in my application which will filter list view depending on letters entered in edit text. Here is what I have actually like a design

enter image description here

So I want to filter the elements by title so I guess I have to change the sqlite statement, because I’m populating the listview from database.

And I have two question :

1.Which is the best way to implement custom search bar : add textwatcher to an edit text and change the sqlite statement everytime user enter letter or ?

2.How to sort in sqlite depending on letters entered from user. If user press A I want to show all items which have that letter no matter if it’s in the beginning or in the end.

  • 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-28T11:11:39+00:00Added an answer on May 28, 2026 at 11:11 am

    So the things to achieve this are very simple, no matter what kind of Adapter are you using. First you need to create TextWatcher and add it to your Edit Text. Than in your onAfterTextChanged() you can create your new SQL statement like :

    String sql = "SELECT title FROM cards WHERE title LIKE '%"+someString+"%'"
    //where someString is `Charsequence` which you get in your onAfterTextChanged()
    

    Before getting your data again if you are using ArrayList or any other kind of Lists for storing your data you have to clear them, so you can get the new data. And than you can simply call adapter.notifySetDataChanged(). And it should work. At least this is the way how I’m doing this. Maybe it’s not the best way, but it’s working.

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

Sidebar

Related Questions

I want to implement something exactly like Changing the Default Text in the Search
I want to implement search feature in my application. I read about android searchable
I'm trying to implement a real-time updating search bar which updates a TreeView when
I want to implement advance search functionality so that if a particular text is
I want to implement a search that will rank results higher, if previous, similar
I want to implement the search option for my application,and auto fill option for
I want to implement a simple search in my application, based on search query
I am working on C#.Net windows application. Here i want to implement search functionality
I want to implement full text search and what I do is this: NSString*
I want to implement search functionality for a website (assume it is similar to

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.