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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:30:22+00:00 2026-06-02T01:30:22+00:00

I am building a contact app which is using SQL database. I have a

  • 0

I am building a contact app which is using SQL database. I have a search function for user. User can search by key in an alphabet and then the list will show from the alphabet to z. For example, if user key is t, the list will show contact names starting from t to z. I create a table whose name is contactstable and store contact name in sname. Below is my code. However, it fails to search. Can anyone please help me?

 public void search(View view) {
    cursor = db.rawQuery("SELECT _id, sname FROM contactstable WHERE sname LIKE ? ORDER BY sname COLLATE NOCASE", 
                    new String[]{"["+searchText.getText().toString() + "-z]%"});
    adapter = new SimpleCursorAdapter(
            this,
            R.layout.employee_list_item, 
            cursor, 
            new String[] {"sname"}, 
            new int[] {R.id.firstName});
    setListAdapter(adapter);
}
  • 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-02T01:30:24+00:00Added an answer on June 2, 2026 at 1:30 am

    I am using the same method as the answer of below post and solve my problem.

    How to use [charlist] Wildcard in android sql search

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

Sidebar

Related Questions

I have this contact list which I'm building using LINQ to SQL. The query
I am building an app to learn Django and have started with a Contact
I'm just starting with Python on Google App Engine building a contact database. What
I'm building an app which is going to have to handle and store a
I'm building a simple Contact Management app with Crud using AngularJS 1.0.0rc8. Getting a
Building a lottery scratch-card app in Java. Have allot of it done, just need
Im building a contact application. In the main activity i have a listview, where
I'm building a contact form (PHP file, design has been already made) which will
Building a website using a PHP based Ecommerce product Magento. The problem I have
I'm building an application using Google App Engine. The application consists of several servlets,

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.