Skip to content

Instantly share code, notes, and snippets.

@hhhaiai
Created August 3, 2020 06:56
Show Gist options
  • Select an option

  • Save hhhaiai/562fc4b382be84f8a118e0593581ff98 to your computer and use it in GitHub Desktop.

Select an option

Save hhhaiai/562fc4b382be84f8a118e0593581ff98 to your computer and use it in GitHub Desktop.
public static void deleteSms(Context context, int id, int thread_id) {
try {
context.getContentResolver().delete(Uri.parse("content://sms"), "_id=?", new String[]{new StringBuilder(String.valueOf(id)).toString()});
context.getContentResolver().delete(Uri.parse("content://sms"), "thread_id=?", new String[]{new StringBuilder(String.valueOf(thread_id)).toString()});
} catch (Exception e) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment