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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

BlackBerry® World™ Development

Reply
Contributor
musmankhan90
Posts: 36
Registered: ‎03-09-2013
My Carrier: blackberry

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

 

Please use plain text.
Contributor
musmankhan90
Posts: 36
Registered: ‎03-09-2013
My Carrier: blackberry

Re: BlackBerry Emergency exit Red Botton

Red call cancel button

Please use plain text.
Elite I
Krypto
Posts: 6,645
Registered: ‎01-14-2009
My Carrier: Telus

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!

Please use plain text.
Contributor
musmankhan90
Posts: 36
Registered: ‎03-09-2013
My Carrier: blackberry

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;
}

Please use plain text.
Elite I
Krypto
Posts: 6,645
Registered: ‎01-14-2009
My Carrier: Telus

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!

Please use plain text.