我目前正在为 Asha 手机制作一个应用程序,包括 3xx 系列和新的 5xx 系列。

我已经有了在 3xx 系列上运行的代码,例如 Asha 310 和 311,但是由于某种原因,当我在 Asha 501 手机上编译并尝试它时,它不起作用..

我收到了'Radio 1 clicked!!!' Asha 310 的模拟器控制台上有消息,但 Asha 501 上没有。

我在 Asha 310/311 上使用 Nokia Java SDK 2.0,在 Asha 501 手机上使用 Nokia Asha SDK 1.1,以及 SDK 中的适当 Asha LWUIT 库。

有谁知道为什么它适用于旧的 Asha 手机而不适用于新手机?

        Form form = new Form("Testing form");
        RadioButton choices[] = new RadioButton[2];
        RadioButton radioButton1 = new RadioButton("Radio 1");
        RadioButton radioButton2 = new RadioButton("Radio 2");

        choices[0] = radioButton1;
        choices[1] = radioButton2;
        PopupChoiceGroup popupChoiceGroup = new PopupChoiceGroup("Testing", choices);

        radioButton1.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                System.out.println("Radio 1 clicked!!!");
            }
        });

        radioButton2.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {
                System.out.println("Radio 2 clicked!!!");
            }
        });
        form.addComponent(popupChoiceGroup);

        form.show();

编辑:我正在使用电话模拟器,所以我可以看到输出。

最佳答案

我建议单独下载 LWUIT 并使用各种版本进行测试。另一个建议是将 PopupChoiceGroup 扩展为您自己的类,然后深入研究 PopupChoiceGroup 的源代码,在进行过程中添加片段和调试。 LWUIT 的怪癖最好在其来源中处理,最好扩展然后修改行为,它确实没有看起来那么令人生畏。

10-08 14:54