解雇黑莓的系统对话框 [英] Dismiss a system dialog on BlackBerry

查看:132
本文介绍了解雇黑莓的系统对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在需要知道什么时候被系统带来了一个未接来电系统对话框了后台运行的黑莓应用程序,并在程序关闭它无需用户干预。我该怎么做?

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?

推荐答案

重点preSS注射装置的关闭的按钮看起来是这样的:

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

可能有用:结果
<一href=\"http://stackoverflow.com/questions/1292896/blackberry-simulate-a-key$p$pss-event/1298900#1298900\">BlackBerry - 模拟一个关键preSS事件

code样品:<​​/ P>

Code sample:

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) {
    }
}

这篇关于解雇黑莓的系统对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆