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
Contributor
ahmednaserfinal
Posts: 43
Registered: ‎07-22-2012
My Device: curve
My Carrier: syudent

how to make a call phone with a number ??

i want to make afuction that take the number and make acall to this number

tnnks in advanced

Please use plain text.
Developer
rishikeshsinghpbh
Posts: 121
Registered: ‎05-31-2012
My Device: 9900
My Carrier: Airtel

Re: how to make a call phone with a number ??

[ Edited ]

 

Hi,

Try the following code,it will ask to make a call in dialog---

 

private void makeCall(String phoneNo) {
        if (Dialog.ask(Dialog.D_YES_NO,"Call : " + phoneNo)==Dialog.YES) {
            try {
                PhoneArguments call=new PhoneArguments(PhoneArguments.ARG_CALL, phoneNo);
                Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, call);
            } catch (Exception e) {}
        }
    }

 

if u do not need the dialog then use the following--

 

private void makeCall(String phoneNo) {
            try {
                PhoneArguments call=new PhoneArguments(PhoneArguments.ARG_CALL, phoneNo);
                Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, call);
            } catch (Exception e) {}
    }

 

Happy Developing!!

Rishikesh Singh
Please use plain text.
Developer
hemant_sain
Posts: 179
Registered: ‎12-09-2011
My Device: 9360, BB10
My Carrier: Aircel

Re: how to make a call phone with a number ??

use the following code:

 

public void CallTo(String phNumber) {
		if (phNumber != null && phNumber != "") {
			synchronized (UiApplication.getEventLock()) {
				try {
					PhoneArguments callArgs = new PhoneArguments(
							PhoneArguments.ARG_CALL, phNumber);
					Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, callArgs);
				} catch (Exception e) {
					e.printStackTrace(e);
				}
			}
		}
	}

 

Please use plain text.