I've been trying to find a way to add a 开发者_如何学Golistener 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);
Are you importing the declaration of Document somewhere?
I do something similar using the BrowserField to pars HTML, see my blog posting here.
精彩评论