Friday, September 6, 2013

How to make a call for last outgoing casll from application

String dialNumber = CallLog.Calls.getLastOutgoingCall(getApplicationContext());
if (dialNumber != "") {
    dialNumber = "tel:"+dialNumber;
    Intent dial = new Intent();
    dial.setAction("android.intent.action.CALL");
    dial.setData(Uri.parse(dialNumber));
    dial.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(dial);
} else {
    Log.e(TAG, "no last outgoing call");
}

No comments:

Post a Comment

You can leave any question here and I will make a response to you ASAP. :D