简体   繁体   English

Android:我可以从已拨电话列表中删除已拨电话号码吗?

[英]Android : Can I remove the dialed number from dialed calls list?

To make a call am using this below code. 要使用以下代码拨打电话。

public void onClick(View v) {
            // TODO Auto-generated method stub
            String number = "892843903";
            Intent callIntent = new Intent(Intent.ACTION_DIAL);
            callIntent.setData(Uri.parse("tel:"+number));
            ctx.startActivity(callIntent);
            deleteNumberFromCallLog(con.number);
        }

So the number is setting and ready to make call. 所以号码正在设置并准备打电话。 If i call the number then number will be added to the dialed list. 如果我拨打该号码,则号码将被添加到拨打的列表中。

But I don't want to show the dialed number in my dialed list. 但我不想在拨打的列表中显示拨打的号码。

Is this possible? 这可能吗? Please give me an idea. 请给我一个主意。

public void deleteNumberFromCallLog(String strNum) {
    this.getContentResolver().delete(CallLog.Calls.CONTENT_URI, CallLog.Calls.NUMBER + " = ?", new String[] { strNum });
}

It requires the following permission 它需要以下许可

<uses-permission android:name="android.permission.WRITE_CALL_LOG" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM