tags:

views:

996

answers:

3

I am deleting an SMS from the inbox but I want to know: How can I delete it before it reaches the inbox?

+5  A: 

I strongly disapprove of even trying to do this

Why? SMS messages are sent when a users subscribes to a service that will result as a cost on a phone bill. Being able to delete an inbound SMS before it ever reaches the inbox allows evil scumbag thieves to hide the fact that the device owner has just been signed up for some premium rate service. These services and bills are hard enough to contest with a mobile phone operator. And after a full billing cycle? Hah...good luck.

Stu Thompson
Yeah, agreed. If you're using SMS as a network layer, either a) don't do that, for the love of god find some other way, or b) deal with them piling up in a thread in the inbox and WARN THE USER HEAVILY ABOUT ALL THE SMS'S BEING USED.
Klondike
WOW that's a new low and I'm not even sure if this is legal to do.
Phill Pafford
A: 

Use SmsManager when receiving the SMS and extend the ContentObserver in the other class.

mahesh
+7  A: 
Christopher
Holy god. This is true! I have always assumed it would be the other way around! For proof, look [here](https://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=telephony/java/com/android/internal/telephony/SMSDispatcher.java;hb=HEAD#l420). Wow. Wish I could give you more than one upvote ;)
Hamy