Search code examples
androidcalllog

Call a phone with out saving number in call logs


I am using following code to make a call.

private void callBack(String phone, Context context) {
    Intent callIntent = new Intent(Intent.ACTION_CALL)
            .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    callIntent.setData(Uri.parse("tel:" + phone));
    context.startActivity(callIntent);

}

It's working fine. After the call ends, it's adding call in the call logs. Is there a way to make a call without saving it? I know we can remove it from logs once it is saved. It is not added to logs as soon as call is ended. It takes time upto 2-3 secs. So, When should i delete it?


Solution

  • I personally use a similar method to modify finished calls and have never had an issue, you should try checking for the call at 1,2,3,5,10? seconds after the call has finished and if it never comes, give up.

    This sounds like a device-dependant issue that won't be predictable as Diallers are usually modified by phone manufacturers.