On Android phones SMS messages registered to applications also get sent to the device's inbox. However to prevent clutter, it'd be nice to be able to remove application specific SMS messages from the inbox to reduce the potential overflow of those messages.
Questions on other Google groups on getting a definitive answer on a programmatic way to delete SMS messages from the Android inbox don't seem to be pressing.
So the scenario:
Has it been done? Can it be done?
Delete individual text messagesTap the conversation. Touch and hold the message you want to delete. Optional: To delete multiple messages, touch and hold the first message, then tap more messages. Tap Delete to confirm.
To delete multiple messages, open the Textra SMS app on your phone and make sure it's set as default. Inside the app, tap and hold on any message you want to delete. When the message gets selected, a green will appear on its left side. To select more messages to delete, tap on them.
Go to Settings, Apps, Apps Manager (or All), find you SMS app. Do a force stop, clear cache and clear data. Exit settings and reboot. that may help.
"As of Android 1.6, incoming SMS message broadcasts (android.provider.Telephony.SMS_RECEIVED
) are delivered as an "ordered broadcast" — meaning that you can tell the system which components should receive the broadcast first."
This means that you can intercept incoming message and abort broadcasting of it further on.
In your AndroidManifest.xml
file, make sure to have priority set to highest:
<receiver android:name=".receiver.SMSReceiver" android:enabled="true"> <intent-filter android:priority="1000"> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver>
In your BroadcastReceiver
, in onReceive()
method, before performing anything with your message, simply call abortBroadcast();
EDIT: As of KitKat, this doesn't work anymore apparently.
EDIT2: More info on how to do it on KitKat here:
Delete SMS from android on 4.4.4 (Affected rows = 0(Zero), after deleted)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With