0
我有一個代碼,刪除與Android的發件箱中的短信,但爲什麼短信不會被刪除..短信不會被刪除
delete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Dialogs.showConfirmation(LookSms.this,"Are you sure?",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int which) {
Intent i = getIntent();
String id_delete_sms = i.getStringExtra("protocol");
String id_delete_thread = i.getStringExtra("address");
// hapus pesan
Uri deleteUri = Uri.parse("content://sms");
getContentResolver().delete(deleteUri,"thread_id=? and protocol=?",
new String[] {String.valueOf(id_delete_thread),String.valueOf(id_delete_sms) });
finish();
Toast.makeText(LookSms.this,"SMS deleted", Toast.LENGTH_SHORT).show();
}
});