How to delete all messages from android inbox or sent folders, without loop
Use following simple function to delete sms from default android application / database.
[sociallocker]
public boolean deleteSms(String smsId) { boolean isSmsDeleted = false; try { mActivity.getContentResolver().delete( Uri.parse("content://sms/" + smsId), null, null); isSmsDeleted = true; } catch (Exception ex) { isSmsDeleted = false; } return isSmsDeleted; }
[/sociallocker]
use this permission in AndroidManifiest
<uses-permission android:name="android.permission.WRITE_SMS"/>