Search code examples
javajava-menokiamidp

J2ME: platformRequest Issue


I want to call a number in below format using platformRequest:

platformRequest("tel:*123*33584744#");

But it gives me error Invalid number on the phone.

But if i call this number manually by typing on phone then it works fine. Even below works fine:

platformRequest("tel:33584744");

So i suspect problem lies when i put * or # chars in the number. As i said when i type these chars in the number manually and press the call button on the mobile it works fine but not with platformrequest.

What is wrong I am doing?

Any alternative to platformrequest method?

How to call a number in below format:

*123*33584744#

Details: CLDC 1.0, MIDP 2.0

Thanks


Solution

  • I found the solution myself:

    I simply changed the text box type to:

    mTextBox = new TextBox("Magic Dialler", "", 25, TextField.ANY);
    // The below line does the trick !!
    // 1: Adds Import From Contacts option
    // 2: Adds Call button for calling just about any number with any special chars !
    mTextBox.setConstraints(3);
    

    http://sarfraznawaz.wordpress.com/2010/03/27/magic-dialler-my-first-j2me-application/