package com.samples.incomingcall;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class OutgoingCallReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(final Context context, final Intent intent) {

            if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {

                String phoneNumber = intent.getExtras().getString(Intent.EXTRA_PHONE_NUMBER);
                    Toast.makeText(context, "Outgoung call number: " + phoneNumber,
                        Toast.LENGTH_LONG).show();
            }
        }
}
