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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:35:52+00:00 2026-05-31T07:35:52+00:00

on the emulator, this code works with no bugs or exceptions: getContentResolver().delete(Uri.parse(content://sms/), body =

  • 0

on the emulator, this code works with no bugs or exceptions:

getContentResolver().delete(Uri.parse("content://sms/"), "body = ? and date = ?", new String[]{body,date)});

the sms is correctly deleted.

But when I try this on galaxy s2, I have an sqliteexception no such column.

I checked with :

Cursor columns = getContentResolver().query(Uri.parse("content://sms"), null,null,null,null);
    for (int i=0;i<columns.getColumnCount();i++){
        Log.i("name", columns.getColumnName(i));
    }

if the columns were there and it was the case, they were all present. It should have worked ass well on the galaxy s2 like on the emulator. I don’t know if this works or is the same on other devices. but from where is this exception coming from?

here is the exception log :

02-07 20:44:32.364: E/AndroidRuntime(14658): 
android.database.sqlite.SQLiteException: no such column: body: , 
while compiling: SELECT _id FROM threads WHERE _id IN (SELECT DISTINCT thread_id FROM
sms WHERE (body = ? and date = ?) UNION SELECT DISTINCT thread_id FROM wpm WHERE 
(body = ? and date = ?) UNION SELECT DISTINCT thread_id FROM pdu WHERE ( locked = 1 
AND body = ? and date = ?))

and here the returned columns for “content://sms” with cursor :

02-07 20:53:21.045: W/KeyCharacterMap(14961): No keyboard for id 0
02-07 20:53:21.060: W/KeyCharacterMap(14961): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
02-07 20:53:26.045: I/ApplicationPackageManager(14961): cscCountry is not German : FTM
02-07 20:53:26.320: I/name(14961): _id
02-07 20:53:26.320: I/name(14961): thread_id
02-07 20:53:26.320: I/name(14961): address
02-07 20:53:26.320: I/name(14961): person
02-07 20:53:26.320: I/name(14961): date
02-07 20:53:26.320: I/name(14961): protocol
02-07 20:53:26.320: I/name(14961): read
02-07 20:53:26.320: I/name(14961): status
02-07 20:53:26.320: I/name(14961): type
02-07 20:53:26.320: I/name(14961): reply_path_present
02-07 20:53:26.320: I/name(14961): subject
02-07 20:53:26.320: I/name(14961): body
02-07 20:53:26.320: I/name(14961): service_center
02-07 20:53:26.320: I/name(14961): locked
02-07 20:53:26.320: I/name(14961): error_code
02-07 20:53:26.320: I/name(14961): seen
02-07 20:53:26.325: I/name(14961): deletable
02-07 20:53:26.325: I/name(14961): hidden
02-07 20:53:26.325: I/name(14961): group_id
02-07 20:53:26.325: I/name(14961): group_type
02-07 20:53:26.325: I/name(14961): delivery_date
  • 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-31T07:35:54+00:00Added an answer on May 31, 2026 at 7:35 am

    I am having the same scenario the Message gets deleted on emulator ,My Htc Desire,Galaxy Mini, But throws exception on Galaxy S,Galaxy SL

    This is what I have done for now .. will Improve/update my answer ..as current implementation is working fine

    try
                {
    
                    Uri deleteUri = Uri.parse("content://sms");
                    int i= getContentResolver().delete(deleteUri, "address=? and date=?", new String[] {Phone, Time});
                    Log.d("*****GE *********", Phone +" "+ Time + "  ^^"+i);
    
                }
                catch(Exception ex)
                {
                    Log.d("deleteEx", ex.toString());
                    Uri deleteUri = Uri.parse("content://sms");
                    int i= getContentResolver().delete(deleteUri, "address=? and date=?", new String[] {Phone, Time});
                    Log.d("*****GE *********", Phone +" "+ Time + "  ^^"+i);
                }
                finally
                {
    
                    finish();
                    overridePendingTransition(R.anim.nothing, R.anim.animout);}
    

    I have put the code in try catch..I try it first Time if its throws exception i do the same in catch and it works.
    Hope it helps.
    I am not a pro .. so i do not know the reason why this is happening

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

Sidebar

Related Questions

This code works fine when running in the emulator: menuAudio = ScreenManager.Game.Content.Load<Song>(music\\MenuEntry); // Kick
I have a problem when I run this snippet of code on the emulator
This code works in a WPF app but throws a NetworkException (server not found)
I have code that works great in the emulator but on a 3gs device
I'm trying to get a webstageview to load a local html file....this code works
Why does this code crash my app onte emulator and on the device -
how to setup opengl to use glTextParameteriv correct. The following code works in emulator
I am trying to display the date on android emulator browser. The current code
I have the following code to parse a date from string: NSString * str
I tried to implement FizzBuzz in DCPU-16. I use this web emulator: http://mappum.github.com/DCPU-16/ (repository:

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.