Get the number I am calling in Android -


I need to get the number that I'm calling programmatically from my Android device. What I am doing now is the following:

I listen to broadcasting android.intent.action.PHONE_STATE which means that I have either called or called. Is a sms etc).

In a broadcaster receiver , I get an additional incoming_number . Regrettably, I can not find the number that is being called If i initiate the call though. How can I do this?

You need to use the intent android.intent.action.I NEW_OUTGOING_CALL In this intention, you can get an additional Intent.EXTRA_PHONE_NUMBER which has an outgoing number.

Intention is issued if a new outgoing call is intanciated.

You will need permission for android.permission.PROCESS_OUTGOING_CALLS .

Hope that helps.

Comments