Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 85
Registered: ‎12-02-2013
My Device: 9360 Curve
My Carrier: BSNL
Accepted Solution

Fetch value of CallType when call is connected using callConnected() method

Hello everyone,

 

i want to get value of CallType when a call is connected i am using this code:

 

public MyClass extends AbstractPhoneListener{

 

private static int callType;

 

public MyClass()

{

}

public void callConnected(int callId) {
        boolean checkType = Phone.getCall(callId).isOutgoing();
        if(checkType)
          callType = PhoneCallLog.TYPE_PLACED_CALL;
        else
         callType = PhoneCallLog.TYPE_RECEIVED_CALL;
        }

}

 

but i didn't get value of callType when call is connected. I also debug application but control didn't went into callConnected method. what should i do now please help.........

Developer
Posts: 16,691
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Fetch value of CallType when call is connected using callConnected() method

did you add the phonelistener?
http://www.blackberry.com/developers/docs/7.1.0api/net/rim/blackberry/api/phone/Phone.html#addPhoneL...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 85
Registered: ‎12-02-2013
My Device: 9360 Curve
My Carrier: BSNL

Re: Fetch value of CallType when call is connected using callConnected() method

Ok simon i add phonelistener and it works well thank you so much for your help.