在Android的特定号码删除通话记录 [英] Delete call log in android for particular number

查看:132
本文介绍了在Android的特定号码删除通话记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除特定号码的所有通话记录。

I am trying to delete all call logs of particular number.

try {
    String strNumberOne[] = {number};
    Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, null, CallLog.Calls.NUMBER + "=? ", strNumberOne, "");
    boolean bol = cursor.moveToFirst();
    if (bol) {
        do {
            int idOfRowToDelete = cursor.getInt(cursor.getColumnIndex(CallLog.Calls._ID));                            
            getContentResolver().delete(Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, String.valueOf(idOfRowToDelete)), "", null);
        } while (cursor.moveToNext());
    }
} catch (Exception ex) {
    System.out.print("Exception here ");
}

我要火 LIKE 查询,因为保存在callLog的mobNum为916666666666,我路过号码6666666666.所以它不匹配。任何人可以帮助我解决这个问题?

I want to fire a LIKE query, because the mobNum saved in callLog is +916666666666 and i am passing number 6666666666. so its not matching. can anybody help me to overcome this issue?

推荐答案

请访问以下链接:

  • <一个href="http://www.dotnetexpertsforum.com/delete-particular-call-log-entry-from-android-programaticaly-t1591.html"相对=nofollow>删除从Android的Programaticaly
  • 特定呼叫日志条目
  • 通话Android中删除日志
  • SO:呼叫结束
  • Delete particular Call log entry from Android Programaticaly
  • Call log deletion in Android
  • SO: Delete call from call log after call end

这篇关于在Android的特定号码删除通话记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆