I am building an application of telephone directory. I am using lwuit for ui building, so my application is running at MIDP2.1 and CDLC1.1. The application is targeted for nokia s40 devices.
When I am calling the platformRequest
method from my form class with a constant number like this piece of code below, where StartApp
is my main MIDlet.
try
{
if (StartApp.getInstance().platformRequest("tel:01239201300") == true)
{
StartApp.getInstance().notifyDestroyed();
}
}
catch(Exception ex)
{
System.out.println(ex);
}
The application runs correctly and a call request is generated, but if I try to do this work like this piece of code below
try{
String number = "tel:" + lblTelNumber.getText();
System.out.println(number);
if (StartApp.getInstance().platformRequest(number) == true)
{
StartApp.getInstance().notifyDestroyed();
}
}
catch(Exception ex)
{
System.out.println(ex);
}
This results in the following exception.
ordinary platformRequest: tel:01239201300
URL is : tel:01239201300
javax.microedition.io.ConnectionNotFoundException: Invalid Phone Number
at javax.microedition.midlet.MIDlet.platformRequest(+76)
at package1.InformationForm.Call(+48)
I don't know what is the problem here?