我正在開發一個阻止來電的應用程序。目前,當來電到達設備時,它會被阻止。但是,從被阻止的呼叫返回後,屏幕會轉到撥號屏幕,並顯示一個對話框以提醒您有未接電話。阻止黑莓的來電
我想攔截來電,掛機時屏幕就是主屏幕。我如何做到這一點?
我的第二個問題:什麼是阻止來電的權限?我如何將它添加到我的應用程序?我添加了「ApplicationPermissions.PERMISSION_IDLE_TIMER」,但沒有用。
EDIT1:
這是我在我的應用程序代碼。
private void blockincomingcall(){
int master_volume= net.rim.device.api.system.Alert.getVolume(); //net.rim.device.api.notification.NotificationsManag er.getMasterNotificationVolume();
System.out.println("Master Volume "+master_volume);
net.rim.device.api.system.Alert.setVolume(0);
int alert_volume = Alert.getVolume();
Main.log("Master Volume after setting "+alert_volume);
int notifi_volume = NotificationsManager.getMasterNotificationVolume();
Main.log("Master Volume 1 after setting "+notifi_volume);
EventInjector.KeyCodeEvent ev1 = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN, ((char) Keypad.KEY_END), KeypadListener.STATUS_ALT, 100);
try
{
Thread.sleep(1000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
EventInjector.invokeEvent(ev1);
EventInjector.invokeEvent(ev1);
net.rim.device.api.system.Alert.setVolume(master_volume);
//System.out.println("Master volume 2 "+master_volume);
requestBackground();
}
當它在os5.0上運行時,它可以阻止呼叫。但屏幕會轉到撥號屏幕,並顯示通知對話框顯示新的來電。而音量設置不起作用。它在OS 7.0和6.0上運行正常,但對卷集沒有影響。我應該怎麼做,謝謝
嗨,先生,這是我的代碼在我的應用程序。 – perry