Doing a phone call in LWUIT

我的梦境 提交于 2019-12-02 05:57:28

问题


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.


回答1:


Also you can do without extend MIDlet using this:

String telNo = "tel no";
Display.getInstance().execute("tel:" + telNo);



回答2:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!