I think the problem is that you're using the old BrowserFieldDemo
. This code has been around for a long time (since way before 7.1), and uses code that's quite a bit more complex than what's been required since BB OS 5.0.
If you want to work directly with net.rim.device.api.browser.field2.BrowserField, then you should check out the BrowserField2Demo
.
In Eclipse, goto BlackBerry -> Import -> BlackBerry Samples -> BrowserField2Demo.
If you then use the newer BrowserField
, you can attach a BrowserFieldListener, which will get called back during normal browser events, similar to the method you mentioned from the old BrowserFieldDemo
. In all those callbacks, you'll see that you do get passed a true instance of BrowserField
, as you wanted.
void documentAborted(BrowserField browserField, Document document) ;
void documentCreated(BrowserField browserField, ScriptEngine scriptEngine, Document document);
void documentError(BrowserField browserField, Document document);
void documentLoaded(BrowserField browserField, Document document);
void documentUnloading(BrowserField browserField, Document document);
void downloadProgress(BrowserField browserField, ContentReadEvent event);