I have a textfield with phone number. All I want to do is when the textfield is focused and call button is pressed, application must be paused and call should be made to the phone number of the textfield using platformRequest API.
I want to do it in lwuit. Can anyone suggest a idea how to do this?
Sample code would be appreciated.
Also you can do without extend MIDlet using this:
String telNo = "tel no";
Display.getInstance().execute("tel:" + telNo);
Your main class should extends with MIDlet
. So there is no issues. You can call like this,
String telNo = "tel no";
platformRequest(telNo );
Suppose If you want to access outside of midlet, you can pass the midlet object to that class and call like this,
String telNo = "tel no";
midlet.platformRequest(telNo ); // midlet is MIdlet object name
来源:https://stackoverflow.com/questions/8921523/doing-a-phone-call-in-lwuit