在BlackBerry上关闭系统对话框

编程入门 行业动态 更新时间:2024-10-25 12:27:04
本文介绍了在BlackBerry上关闭系统对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个BlackBerry应用程序在后台运行,需要知道系统何时启动未接来电系统对话框,并在没有用户干预的情况下以编程方式关闭它。我可以这样做吗?

I have a BlackBerry app running in the background that needs to know when a "Missed call" system dialog is brought up by the system, and programmatically close it without user intervention. How can I do that?

几乎可以知道对话框的建立,即稍后我以编程方式结束通话。 ..但是如何获得对话框的引用,并关闭它?

I could actually almost know when the dialog is brought up, i.e. a little later I programmatically end the call...but how can I get a reference to the dialog, and close it?

推荐答案

设备的按键注入关闭按钮如下所示:

Key press injection for device Close button looks like this:

KeyEvent inject = new KeyEvent(KeyEvent.KEY_DOWN, Characters.ESCAPE, 0); inject.post();

不要忘记设置设备版本的权限:选项=>高级选项= >应用程序=> [您的应用程序] =>编辑默认权限=>交互=>键击注入

Don't forget to set permissions for device release: Options => Advanced Options => Applications => [Your Application] =>Edit Default permissions =>Interactions =>key stroke Injection

可能有用: BlackBerry - 模拟一个KeyPress事件

代码示例:

class Scr extends MainScreen implements PhoneListener { public Scr() { Phone.addPhoneListener(this); } public boolean onClose() { Phone.removePhoneListener(this); return super.onClose(); } public void callDisconnected(int callId) { Timer timer = new Timer(); timer.schedule(new TimerTask(){public void run() { KeyEvent event = new KeyEvent(KeyEvent.KEY_DOWN, Characters.ESCAPE, KeyListener.STATUS_NOT_FROM_KEYPAD); event.post(); }}, 1000); } public void callAdded(int callId) { } public void callAnswered(int callId) { } public void callConferenceCallEstablished(int callId) { } public void callConnected(int callId) { } public void callDirectConnectConnected(int callId) { } public void callDirectConnectDisconnected(int callId) { } public void callEndedByUser(int callId) { } public void callFailed(int callId, int reason) { } public void callHeld(int callId) { } public void callIncoming(int callId) { } public void callInitiated(int callid) { } public void callRemoved(int callId) { } public void callResumed(int callId) { } public void callWaiting(int callid) { } public void conferenceCallDisconnected(int callId) { } }

更多推荐

在BlackBerry上关闭系统对话框

本文发布于:2023-11-25 12:27:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629749.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对话框   系统   BlackBerry

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!