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

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: How to prevent screen navigation using BlackBerry "back" key?

Check for Keypad.KEY_ESCAPE instead of Keypad.KEY_BACKSPACE




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Developer
Posts: 154
Registered: ‎01-08-2010
My Device: 8310 Rogers
My Carrier: Vodafone

Re: How to prevent screen navigation using BlackBerry "back" key?

Hi

 

I tried Keypad.KEY_ESCAPE instead of Keypad.KEY_BACKSPACE. The problem is still same.

 

The one thing I just noticed if I start my application and go to screen 1, screen 2, screen 3, screen 4,screen 5 and then on screen 6. On screen 6 when I click back it goes to screen 2 and not on screen 5. If I click on back key again it goes to screen 1 and then finally on blackberry desktop. 

 

Why is this happening?

Developer
Posts: 154
Registered: ‎01-08-2010
My Device: 8310 Rogers
My Carrier: Vodafone

Re: How to prevent screen navigation using BlackBerry "back" key?

No matter how many screen i navigate to , it always goes back to the same screen i.e. second screen of the application on click of back screen.

Developer
Posts: 154
Registered: ‎01-08-2010
My Device: 8310 Rogers
My Carrier: Vodafone

Re: How to prevent screen navigation using BlackBerry "back" key?

Hi

 

The below code worked for me.

 

 

protected boolean keyChar(char c, int status, int time) {
	// TODO Auto-generated method stub
	if (c == Keypad.KEY_ESCAPE) {
		return true;
	}
	return super.keyChar(c, status, time);
}

 

 

Now when I click on back button it does not navigate to previous screens. It basically does not do anything.

 

User can go to desktop by clicking on red exit button and when starts app again he can go to the same screen which was there at time of exiting.

 

Can we not make it so that when the user clicks on the back button it behaves like red exit button and take user to the blackberry desktop instead of doing nothing?

 

 

Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: How to prevent screen navigation using BlackBerry "back" key?

Look back at Arkady's post. You need to call Application.getApplication().requestBackground() before returning true when the escape key is pressed.




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.