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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:51:30+00:00 2026-05-23T09:51:30+00:00

Does anyone know how to do that? Even links to some tutorials would help.

  • 0

Does anyone know how to do that? Even links to some tutorials would help.

I’m using a device with Android 2.1.

  • 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-23T09:51:31+00:00Added an answer on May 23, 2026 at 9:51 am
    i found it myself.. thanks everyone...  
    
    
    public void updateContact(String name, String phone,ContentResolver cr,Activity a) 
        {
    
        String[] arr = {"DISPLAY_NAME","MIMETYPE","TYPE"};
    
        String where = ContactsContract.Data.DISPLAY_NAME + " = ? AND " + 
                    ContactsContract.Data.MIMETYPE + " = ? AND " +
                    String.valueOf(ContactsContract.CommonDataKinds.Phone.TYPE) + " = ? ";
        String[] params = new String[] {name,
                ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE,
                String.valueOf(ContactsContract.CommonDataKinds.Phone.TYPE_HOME)};
    
       Cursor phoneCur = a.managedQuery(ContactsContract.Data.CONTENT_URI, null, null, null, null);
       for(int i = 0; i<phoneCur.getColumnCount()-1;i++)
       {
           if(phoneCur.moveToNext())
           {
               String s = phoneCur.getString(phoneCur.getColumnIndex(Data.DISPLAY_NAME));
               String s1 = phoneCur.getString(phoneCur.getColumnIndex(Data.MIMETYPE));
               String s2 = phoneCur.getString(phoneCur.getColumnIndex(Phone.TYPE));
               if(s!=null)
               {
                   Log.e("@@@@@@@@@@@@#############",s);
               }
               if(s1!=null)
               {
                   Log.e("111111111111#############",s1);
               }
               if(s2!=null)
               {
                   Log.e("2222222222222#############",s2);
               }
           }
       }
    
        ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
    
    
            ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
                    .withSelection(where, params)
                    .withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, "5657")
                   // .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, "Sample Name 21")
                    .build());
            String where1 = ContactsContract.Data.DISPLAY_NAME + " = ? AND " + 
            ContactsContract.Data.MIMETYPE + " = ?";
            String[] params1 = new String[] {name,"vnd.android.cursor.item/name"};
            ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
                    .withSelection(where1, params1)
                    .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, "Sample Name")
                    .build());
    
    
            String[] params2 = new String[] {name,"vnd.android.cursor.item/email_v2"};
            ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
                    .withSelection(where1, params2)
                    .withValue(ContactsContract.CommonDataKinds.Email.DATA, "Hi There")
                    .build());
       // phoneCur.close();
    
        try {
            cr.applyBatch(ContactsContract.AUTHORITY, ops);
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (OperationApplicationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of some good tutorials that explain how to use the JQuery
Does anyone know of any existing projects that aim to port Android's Java VM
Does anyone know how sites that have a real-time feed of a lot of
Does anyone know a good Java lib that will hook into SVN so I
Does anyone know of any free tools that can assist in converting an SQL2005
Does anyone know any good tool that I can use to perform stress tests
Does anyone know of a script that can select all text references to URLs
Does anyone know of any notepad++ plugin that saves a version of whatever I'm
Does anyone know if the problems that have been affecting Stack Overflow with regards
Does anyone know a good tool that can be run on a page (for

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.