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
Visitor
Posts: 1
Registered: ‎06-14-2012
My Device: Bold -- 9870
My Carrier: 5043107628

Browserfield Example not launching

Greetings All,

 

I'm attempting to run a very simple Blackberry/Java application which implements the BrowserField class. When I launch it in the simulator it just hangs. When I launch it on my device nothing happens.

JRE: 7.0
Simulator: 4.0.0.141

 

 

package mypackage;

import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.browser.field2.BrowserFieldConfig;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;

public class BrowserJazz extends UiApplication
{
public static void main(String[] args)
{
BrowserJazz app = new BrowserJazz();
app.enterEventDispatcher();
}

public void BrowserJazz()
{
pushScreen(new BrowserFieldDemoScreen());
}
}

class BrowserFieldDemoScreen extends MainScreen
{
public BrowserFieldDemoScreen()
{
BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();

 


myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
BrowserFieldConfig.NAVIGATION_MODE_POINTER);

BrowserField browserField = new BrowserField(myBrowserFieldConfig);

/*BrowserFieldListener listener = new BrowserFieldListener() {
public void documentLoaded(BrowserField browserField) throws Exception
{
// the document has loaded, do something ...
Dialog.inform("PAGE LOADED!");
}
};*/

add(browserField);
//browserField.addListener( listener );

browserField.requestContent("http://www.google.com");
//browserField.addListener( listener );

}
}

 

Any ideas?

-TU

Developer
Posts: 228
Registered: ‎10-01-2011
My Device: Passport

Re: Browserfield Example not launching

Try this in your screen:

 

public final class TestScreen extends MainScreen
{

     BrowserField browserField;
     

    public TestScreen()

    {
        BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();

        myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
        BrowserFieldConfig.NAVIGATION_MODE_POINTER);
        browserField = new BrowserField(myBrowserFieldConfig);
        add(browserField);

        addMenuItem(goMenu);
    }

 

    private MenuItem goMenu = new MenuItem("Go", 0x240000, 0){
         public void run(){
               browserField.requestContent("http://www.google.com");
         }
    };
}

 

Push this screen then select Go form the menu. I found that setting the content of the brower field in the construction will cause issues, I suspect because the field may not be fully instantiated when you are attempting to populate it.