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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:12:58+00:00 2026-05-27T07:12:58+00:00

I am currently using the ContentProvider for contacts to retrieve the contacts from the

  • 0

I am currently using the ContentProvider for contacts to retrieve the contacts from the device and allowing the user to filter the results by typing into an EditText.

To do so I have set up a filter query on a SimpleAdapter as follows:

    contactsAdapter.setFilterQueryProvider(new FilterQueryProvider() {
        String[] PROJECTION = new String[] {
                ContactsContract.Contacts._ID,
                ContactsContract.Contacts.DISPLAY_NAME,
                ContactsContract.Contacts.HAS_PHONE_NUMBER,
        };
        String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED COLLATE NOCASE ASC";

          public Cursor runQuery(CharSequence constraint) {
            String SELECTION = "LOWER(" + ContactsContract.Contacts.DISPLAY_NAME + ")" 
            + " LIKE '" + constraint + "%' " + "and " + ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '1'";
            Cursor cur = managedQuery(ContactsContract.Contacts.CONTENT_URI, 
                    PROJECTION, SELECTION, null, sortOrder);
            return cur; 
          }
        });
    setListAdapter(contactsAdapter); 

This works in most cases however when I have a contact with an accent (Example: Tést Cóntact) then I want the contact to show up even if the user types in Test Contact, currently it doesn’t.

Also the case is not ignored in this case either whereas for standard characters it is, for example if I have a contact called Omar and search for omar it matches but if I have a contact called Ómar and search for ómar it doesn’t match.

Does anyone know what I should be doing to implement the behavior I want to achieve?

  • 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-27T07:12:59+00:00Added an answer on May 27, 2026 at 7:12 am

    I would see 2 options here :

    • Create a table that contains accent-less version of the contacts names and a reference to the actual contact Id
    • Replace accented caracters by ? in your search (which may result in not really user expected behaviour, but is so much simpler)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
Currently using the HTTPServletRequest class and specifically the .getQueryString method to retrieve an inputted
I am currently using Windows Server 2008 Standard and have several Hyper V machines.
Im currently using a UITableView like any other, and I am researching into the
I am currently using matplotlib.pyplot to create graphs and would like to have the
Currently I'm using ContentProvider in my application. Because of layers and no actual need
Im currently using the Barcode Scanner from the open source library Zxing in my
Currently using cocos2d. I have a plist data name myplist.plist. Inside the plist are
Im currently using base64_encode for some $_GET params that i don't want regular user
I'm currently using the following command in bash to list the info from an

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.