Showing posts with label phone. Show all posts
Showing posts with label phone. Show all posts

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");
}