开发者

Pressing the green key in blackberry

开发者 https://www.devze.com 2023-04-01 19:37 出处:网络
I want to know when the user presses the green bu开发者_JAVA技巧tton in the device to initiate a phonecall from the app directly. What event is fired when the green key is pressed?

I want to know when the user presses the green bu开发者_JAVA技巧tton in the device to initiate a phonecall from the app directly. What event is fired when the green key is pressed?

Thanks


You need to implement KeyListener

import net.rim.device.api.system.KeyListener;

override the function

public boolean keyDown(int keycode, int time)

and inside it catch the event of pressing buttons.

How do you check which button was pressed?

if (Keypad.KEY_SEND == Keypad.key(keycode)) {//your code}

find the API DOC here : http://www.blackberry.com/developers/docs/4.0.2api/net/rim/device/api/ui/Keypad.html


I found the answer to be something similar to this.

Override keyDown:

public boolean keyDown(int keycode, int time)
{
   if (keycode == Keypad.SEND)
  {
    //handle your event
    return true;
  }
  return super.keyDown(keycode, time);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消