I need to hide the incoming call screen in Blackberry. I have used this new api from OS v5.0 onwards net.rim.blackberry.api.phone.phonegui.PhoneScreen this helps to add your own logo and stuff. But my problem is I need to show the call is coming in, but disable all the keys, including the key to pick up calls. The user will be able to pick up calls only when he is connected to the bluetooth in the car through his steering wheel.
Even for Bluetooth I am jus开发者_JAVA技巧t able to get the paired devices and not the connected devices.
you have to use thing following code to block the incoming call. You can also visit this link to get complete code sample block-incoming-call-in-blackberry
final PhoneCall call = Phone.getCall(callId);
final String number = call.getDisplayPhoneNumber();
System.out.println(number);
EventInjector.KeyCodeEvent pressEndKey = new EventInjector.KeyCodeEvent( KeyCodeEvent.KEY_DOWN, (char) Keypad.KEY_END, 0, 100);
EventInjector.KeyCodeEvent releaseEndKey = new EventInjector.KeyCodeEvent( KeyCodeEvent.KEY_UP, (char) Keypad.KEY_END, 0, 100);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);
You cant hide the incoming call screen!! You can block the incoming call or add fields to the screen. So think about changing to one of the two options.
To add fields to the incoming call screen use PhoneScreen API
To block the call use what Neel provided you:
http://www.codinguru.com/2011/08/block-incoming-call-in-blackberry.html
精彩评论