0

This is my code for selecting the contact number from the phonebook. I'm able to search and select the contact number from the mobile phone contact list. But, I want to select multiple contacts and add them in the textfield.

tb2 = new TextField("To: ", "", 30, TextField.PHONENUMBER);
            tb3 = new TextField("Message: ", "", 300, TextField.ANY);
            form1.append(tb2);
            form1.append(tb3);

            form1.addCommand(submitCommand);
            //display.setCurrent(tb3);
            display.setCurrent(form1);
4

2 に答える 2

1

PHONENUMBER 制約を使用する場合、電話番号は 1 つだけ存在する必要があります。APIによると:

「PHONENUMBER フィールドは、使用されている電話番号の規則に応じて、数字を国コード、市外局番、プレフィックスなどにグループ化して、数字の区切り記号と句読点を使用して表示される場合があります。提供されたスペースまたは句読点は、テキスト オブジェクトの実際の一部とは見なされません。たとえば、PHONENUMBER 制約のあるテキスト オブジェクトは「(408) 555-1212」のように表示されますが、API を介してアプリケーションに表示されるオブジェクトの実際の内容は、文字列「4085551212」になります。

代わりに、MULTIPLE タイプの ChoiceGroup を使用してみてください。

于 2012-05-16T11:20:32.830 に答える
-1

どうしたの?

    /**
     *@param current - your current TextField String
     */
    public String addContact(String current) {
        return current += "," + getNextContact();
    }

    public String getNextContact() {
        //here should be the code that gives you single one
    }
于 2012-05-16T10:32:09.333 に答える