Jack Gleeman
Jack Gleeman

Reputation: 593

Trouble refreshing browserField

I have a problem that I'm sure will have a simple solution. I have a browser that loads a URL using this code:

myBrowserFieldConfig.setProperty(
            BrowserFieldConfig.NAVIGATION_MODE,
            BrowserFieldConfig.NAVIGATION_MODE_POINTER);    //browser field for navigation
    final BrowserField browserSession = new BrowserField(myBrowserFieldConfig); //browser session to open the url 


    browserSession.requestContent(URLLocation);

However what I want to do is when I click a button, the browserSession should reload the webview with the given URL, I tried doing it like this:

buttonField_1.setChangeListener(new FieldChangeListener() { //listener for exit button.
        public void fieldChanged(Field arg0, int arg1) {
            browserSession.requestContent("http://m.cloudsave.co.uk/Loginscreen.aspx");
            }
    });

When I click it, the application crashes and goes to debug mode, that's all I can give. I get no exception or anything. Does anyone know the reason for this?

Upvotes: 0

Views: 269

Answers (1)

Jack Gleeman
Jack Gleeman

Reputation: 593

all I had to do was add setFocus() to my browsersession before requesting the new content.

For example:

                browserSession.setFocus();
                browserSession.requestContent(URLLocation);

Upvotes: 1

Related Questions