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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:11:11+00:00 2026-06-04T23:11:11+00:00

I have this code to delete a Call from CallLog.Calls provider : String strNumber=

  • 0

I have this code to delete a Callfrom CallLog.Callsprovider :

            String strNumber= "myPhoneNumber"

            String queryString= "NUMBER='" + strNumber + "'";

            Log.v("Number", queryString); 

            int i=context.getContentResolver().delete(CallLog.Calls.CONTENT_URI, queryString, null); 
            if(i<1) 

            {  
               // do my stuff
            } 

This code work on android 2.2 but it does’nt work on android 2.3.3

There’is no error in the LogCat.

  • 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-04T23:11:14+00:00Added an answer on June 4, 2026 at 11:11 pm

    You should use the contract class provided by the SDK ( CallLog.Calls in your situation ) when building your queries.

    The contract classes are meant to map the object model to the corresponding data names in the database. When the android team need to update a column name in the database, they also update the contract class and then no change is required for developpers.

    Then try to change you query string to :

    String queryString = CallLog.Calls.NUMBER + "='" + strNumber + "'";
    

    NOTE: the single-quote marks are necessary.

    Also make sure the number is exactly matching the database number.

    ( +33678541236 != 0678541236 )

    To be sure to delete the correct row you can do the following :

    Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, null, CallLog.Calls.NUMBER + " = ? ", strNumber , "");
    int idOfRowToDelete = cursor.getInt(cursor.getColumnIndex(CallLog.Calls._ID));
    getContentResolver().delete(Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, String.valueOf(idOfRowToDelete)), "", null);
    

    (didn’t try it but should work with small corrections)

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

Sidebar

Related Questions

This code is what i have tried to process the query, either delete or
I have tried posting this earlier and had to delete it because the code
i have this code local strs = my dog print (string.gsub( strs , ,%20))
I have this code: std::string name = kingfisher; char node_name[name.size()+1]; strcpy(node_name,name.c_str()); node_name[name.size()] = '\0';
I have this code: public function getRecurringEventsByGrouped($grouped){ $query = SELECT * FROM `event` AS
I have a page generated from PHP like this: <?php //In my original code,
I have this code $(.delete2).click(function() { $('#load2').fadeIn(); } I have dynamically added item via
I had this code working before, but have somehow deleted it as I was
have this code: template<typename T, template<typename, typename> class OuterCont, template<typename, typename> class InnerCont, class
I have this code : h1, h2, h3, h4{ color: red; } .message_rouge h1,

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.