Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New Out Going Call Action

Tags:

android

In my application I have apply new outgoing call receiver. It is working fine. I get whenever new outgoing call is made.

But now, in my device there are two applications for dial call. First is default dialer and second is my own dialer (Using Call_Privilage).

My question is: when I got broadcast for new dial in my receiver at that time how can I know that from which dialer application call is dialed. From default dialer or my own dialer?

like image 238
user861973 Avatar asked Jun 04 '12 08:06

user861973


1 Answers

I have not implemented this and tested but I assume like this will work for you.

In your own dialer Activity whenever you are calling intent to make a call, at that time you should pass one more putExtra with that callIntent

For Ex : callIntent.putExtra("fromMyDialer",1);

Now in your Receiver file, you will be having one method like this below and there you will just need to have check for the extra we passed above.

@Override
public void onReceive(final Context context, final Intent intent) {
    if(intent.getIntExtra("fromMyDialer",0)==1)
      // from my own dialer activity
    else
        // from default dialor of phone

}
like image 99
MKJParekh Avatar answered Oct 09 '22 16:10

MKJParekh