Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何知道配置文件在blackberry中更改为振动模式?_Blackberry - Fatal编程技术网

如何知道配置文件在blackberry中更改为振动模式?

如何知道配置文件在blackberry中更改为振动模式?,blackberry,Blackberry,我正在尝试一个应用程序,其中我使用了一个标签和一个按钮 我想当用户点击该按钮时,“选择配置文件”弹出屏幕是打开的 当用户选择振动模式时,标签必须设置为“振动开启”,而对于其他模式,标签则设置为“振动关闭” 我试过了,但在选择配置文件后,标签并没有立即设置 这是我的密码 public final class MyScreen extends MainScreen { /** * Creates a new MyScreen object */ LabelFiel

我正在尝试一个应用程序,其中我使用了一个标签和一个按钮

我想当用户点击该按钮时,“选择配置文件”弹出屏幕是打开的

当用户选择振动模式时,标签必须设置为“振动开启”,而对于其他模式,标签则设置为“振动关闭”

我试过了,但在选择配置文件后,标签并没有立即设置

这是我的密码

public final class MyScreen extends MainScreen
{
    /**
     * Creates a new MyScreen object
     */
    LabelField lbl;
    ButtonField btnOk;
    public MyScreen()
    {        
        // Set the displayed title of the screen       
        setTitle("MyTitle");
        lbl=new LabelField("Set profile ");
        btnOk=new ButtonField("OK");
        btnOk.setChangeListener(new FieldChangeListener() {

            public void fieldChanged(Field field, int context) {
                // TODO Auto-generated method stub
                try {
                    ApplicationManager .getApplicationManager().launch("net_rim_bb_profiles_app");
                } catch (ApplicationManagerException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                if(NotificationsManager.isVibrateOnly())
                {
                    lbl.setText("Vibration on");
                }
                else
                {
                    lbl.setText("Vibration Off");
                }


            }
        });
        add(lbl);
        add(btnOk);

    }
}
请帮帮我,从一周开始

重写OnExposed()并在该方法中编写以下代码

invalidate();
if(NotificationsManager.isVibrateOnly())
        {
            lbl.setText("Vibration on");
        }
        else
        {
            lbl.setText("Vibration Off");
        }

这对我有好处。::D

我还通过添加GlobalEvent Listener使用了它,但它并没有显示设备的变化,而是在模拟器上工作。如果有人知道,请帮助。