如何知道黑莓中的个人资料已更改为振动模式?
我正在尝试一个应用程序,其中我需要一个标签和一个标签。一键。
我希望当用户单击该按钮时“选择个人资料”弹出屏幕打开。
当用户选择振动配置文件时,标签必须设置为“振动打开”和“振动打开”。对于其他配置文件,它设置为“振动关闭”
我尝试过,但选择配置文件后该标签并未立即设置。
这是我的代码
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
重写 OnExpose() 并在该方法中编写以下代码
这对我很有用。 :) :D
override OnExposed() and wrote in that method following code
This works good for me. :) :D