PopupChoiceGroup actionlistener 無法在 Asha 501 上工作



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

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

我在 Asha

310 的模拟器控制台上收到"Radio 1 单击!!"消息,但在 Asha 501 上没有。

我正在为Asha 310/311使用诺基亚Java SDK 2.0,在Asha 501手机上使用诺基亚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的怪癖最好在其来源中处理,最好扩展然后修改行为,它确实不像看起来那么令人生畏。

最新更新