Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® World™ Development

Reply
Regular Contributor
musmankhan90
Posts: 92
Registered: ‎03-09-2013
My Device: bold 9800

BlackBerry Emergency exit Red Botton

[ Edited ]

Hello,

I want to know the sample code for Emergency exit Red Botton. I want to perform some action if red button is pressed on ACTION Bar.. 

Thanks.

URL of that  Image is given below:

https://skydrive.live.com/redir?resid=1E8F82E79864E0BB!141&authkey=!AD4HCGYd2YRFZaQ

 

Regular Contributor
musmankhan90
Posts: 92
Registered: ‎03-09-2013
My Device: bold 9800

Re: BlackBerry Emergency exit Red Botton

Red call cancel button

Elite I
Krypto
Posts: 6,657
Registered: ‎01-14-2009
My Device: BlackBerry Z10

Re: BlackBerry Emergency exit Red Botton

I don't believe you can use the red end button for anything as it has been hardcoded into the OS that pressing the red end button will end a call (if in the phone app on an active call) or minimize the app and return to the homescreen.

I hope that info helps.

If you want to thank someone for their comment, do so by clicking the Thumbs Up icon.

If your issue is resolved, don't forget to click the Solution button on the resolution!

Regular Contributor
musmankhan90
Posts: 92
Registered: ‎03-09-2013
My Device: bold 9800

Re: BlackBerry Emergency exit Red Botton

Thanx Krypto for your reply,i got the solution. It is possible to perform our desired action on RED Button. Sample code is given below:

protected boolean keyDown(int keycode, int time)
{
//keycode for green button
if (keycode == 1114112)
{
return true;
}
////keycode for red button
else if (keycode == 1179648)
{
Dialog.alert("Emergency Exit");

}
else
{
return super.keyDown(keycode, time);
}
return true;
}

Elite I
Krypto
Posts: 6,657
Registered: ‎01-14-2009
My Device: BlackBerry Z10

Re: BlackBerry Emergency exit Red Botton

Ok, good to know and I hope it works for you without the OS actually overriding it. :smileyhappy:

If you want to thank someone for their comment, do so by clicking the Thumbs Up icon.

If your issue is resolved, don't forget to click the Solution button on the resolution!