How to change title of BlackBerry BrowserField when a certain link is clicked

450 views Asked by At

I've been trying to find a way to add a listener to the BlackBerry BrowserField for when the user clicks a link and the URL changes. I have tried adding a BrowserFieldListener below, but I keep getting a warning message declaring that Document cannot be resolved as a type. Any suggestions on capturing when a user clicks a link and it takes them to a certain URL?

BrowserFieldListener listener = new BrowserFieldListener(){
public void documentLoaded(BrowserField browserField, Document document) throws Exception
    {

          browswerField.setTitle("Example");        
    }

};
browserField.addListener(listener);
1

There are 1 answers

1
Richard On BEST ANSWER

Are you importing the declaration of Document somewhere?

I do something similar using the BrowserField to pars HTML, see my blog posting here.