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
Highlighted
Developer
Posts: 174
Registered: ‎01-25-2011
My Device: Not Specified

Back button functionality in browser field

[ Edited ]

Hi all,

I have loads of html pages to be loaded in my browser field, in which i have used keyChar method to recognize the back button pressed by the user to navigate to the previous pages using the browserHistory's goBack() method.

 

Every thing worked fine until i came across device with some bundle no. 2921 in blackberry 9800, where the function goBack() is not working. Even the checkGoBack() method is returning false despite having html pages below the current one. 

 

Apart from the above bundle they are few more bundles where those two methods are not working as expected. I even tried using browserField's back() method but with no luck. I have also tried the same app in 9700 with bundle no 1879, even that has failed to work.

 

But the best part is, the app is working properly on all os 7.0 bundles like 9900 device. 

 

The problem is with os 6.0 Latest bundles as on the bundle n0. 695 device it is working fine again.

 

Developed on OS 6.0

Ported on OS 6.0 n above(7.0)

 

The code snippet that i have used is below:

 

protected boolean keyChar(char key, int status, int time) {
		if (key == Characters.ESCAPE) {
			Application.getApplication().invokeLater(new Runnable() {
				public void run() {

					if (browserField.getHistory().canGoBack())
					{
						browserField.getHistory().goBack();//browserField.back();
					}
				}

			});
			return true;
		}

		return super.keyChar(key, status, time);
	}