Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've got a little problem, using the ContentResolver for inserting, updating and deleting a SMS on my Nexus 5.

I searched a lot and tried everything which was suggested, but my smartphone still does not want to change it's entries in the SMS-database.

My Code for deleting all SMS with a specific address looks like this:

int i = a.getContentResolver().delete(Telephony.Sms.CONTENT_URI,
            Telephony.Sms.ADDRESS + "=?", new String[] { "0820800650" });

The return value is 0, for whatever condition I use. The address exists in database (searched it successfully with query) and the permissions are all in the manifest.

Please help me. I have no clue, what else I could try!

Best regards, Alex Lang


Hi!

Ich hab' ein kleines Problem beim insert, update und delete von ContentResolver auf meinem Nexus 5.

Ich hab' im Netz schon so einige Foren abgeklappert und auch alles Vorschl?ge dort versucht, aber ohne Erfolg.

Meinen Code k?nnt ihr weiter oben sehen.

Der zurückgegebene Wert ist immer 0, egal welche Condition ich verwende. Es existieren SMS mit dieser Adresse (ich habe sie schon erfolgreich mit quere gefunden) und die Permissions sinst auch alle in der Manifest.

Helft mir bitte! Ich wei? nicht, was ich sonst noch ausprobieren k?nnte...

Mit freundlichen Grü?en, Alex Lang

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
136 views
Welcome To Ask or Share your Answers For Others

1 Answer

On Android 4.4+ -- which your Nexus 5 should be running -- only the user's chosen SMS client will have write access to the SMS ContentProvider.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...