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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:43:58+00:00 2026-05-23T10:43:58+00:00

Please help i want to update phone persons phone number but gets error 06-25

  • 0

Please help i want to update phone persons phone number but gets error

06-25 17:43:57.559: ERROR/DatabaseUtils(97): Writing exception to parcel
06-25 17:43:57.559: ERROR/DatabaseUtils(97): java.lang.UnsupportedOperationException: Unknown uri: content://com.android.contacts/contacts/1/phones


import android.app.Activity;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Contacts.People;
import android.provider.ContactsContract;

@SuppressWarnings("deprecation")
public class ChangeContacts extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ContentResolver cr = getContentResolver();
        Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,
                null, null, null, null);
        if (cur.getCount() > 0) {
        while (cur.moveToNext()) {
            String id = cur.getString(
                        cur.getColumnIndex(ContactsContract.Contacts._ID));
        String name = cur.getString(
                        cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
        System.out.println(name);

        if (Integer.parseInt(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) {





            Cursor pCur = cr.query(
                    ContactsContract.CommonDataKinds.Phone.CONTENT_URI, 
                    null, 
                    ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?", 
                    new String[]{id}, null);
            Uri PersonUri=null;
            Uri PhoneUri = null;
            ContentValues values = new ContentValues();
                    while (pCur.moveToNext()) {
                        String phhoneNumber=pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
                        String contactId=pCur.getString(pCur.getColumnIndex(ContactsContract.Contacts._ID));
                        System.out.println(contactId);



 PersonUri=ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,Long.valueOf(contactId));
PhoneUri = Uri.withAppendedPath(PersonUri, People.Phones.CONTENT_DIRECTORY);


values.clear();

values.put(People.Phones.TYPE,People.Phones.TYPE_MOBILE);
values.put(People.Phones.NUMBER,"123456789");


 int upv=getContentResolver().update(PhoneUri,values, null, null); 
                        System.out.println(upv);
                    System.out.println(phhoneNumber);
                    } 
                    pCur.close();





            }
            }
    }




    }


}
  • 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-23T10:43:58+00:00Added an answer on May 23, 2026 at 10:43 am

    Problem solved I wrote this function for update contact mobile phone numbers

    phoneId – phoneId (we want to change this value)

    
    private void updateRecord(int phoneId,String number) {
        Uri uri = ContentUris.withAppendedId(Phones.CONTENT_URI, phoneId);
            values = new ContentValues();
            values.put(People.Phones.TYPE,People.Phones.TYPE_MOBILE);
            values.put(People.Phones.NUMBER, number);
            getContentResolver().update(uri, values, null, null);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

please help me. I want know about what types of flags to run an
Can somebody please help me, I want to put the OK symbol throw HTML
Could someone please help me in here, I'm just a beginner who want to
Hi i want to upload mulitiple file using rails 3 and paperclip please help
I want to add background image to uinavigationcontroller. Please help me.
i Want to fetch this data using json decode. Please Help.. So far i
Desperate, please help. Will work for food :) I want to be able to
I have a web form and i want to call Asynchronously Ajax.ActionLink(). Please help
This is my 3rd SO question. Please help again... I want to put up
I cannot find where the sqlcmd is? i just want the prompt. please help!

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.