如何知道黑莓中的个人资料已更改为振动模式?

发布于 2025-01-01 22:01:42 字数 1379 浏览 1 评论 0原文

我正在尝试一个应用程序,其中我需要一个标签和一个标签。一键。

我希望当用户单击该按钮时“选择个人资料”弹出屏幕打开。

当用户选择振动配置文件时,标签必须设置为“振动打开”和“振动打开”。对于其他配置文件,它设置为“振动关闭”

我尝试过,但选择配置文件后该标签并未立即设置。

这是我的代码

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);

    }
}

,请帮助我,从 1 周开始做.......

I am tring one application where i take one label & one button.

I want when user clicks on that button 'Select Profile' popup screen is open.

when user selects vibration profile then label must be set to " Vibration On " & for other profile it is set as "Vibration Off "

I tried it but that Label is not setting immideatly after selecting profile.

This is my code

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);

    }
}

Pleease please help me ,doing it from 1 week .......

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亽野灬性zι浪 2025-01-08 22:01:42

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

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

这对我很有用。 :) :D

override OnExposed() and wrote in that method following code

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

This works good for me. :) :D

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文