BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
protocolController = new ProtocolController(browserField)
{
public void handleNavigationRequest(final BrowserFieldRequest request) throws Exception
{
try
{
//save image from <a href="clickimage"><img src="http://mydomain.com/image.jpg></a>
}
catch (Throwable e)
{
}
}
public InputConnection handleResourceRequest(BrowserFieldRequest request) throws Exception {
return super.handleResourceRequest(request);
}
};
myBrowserFieldConfig.setProperty(BrowserFieldConfig.CONTROLLER, protocolController);
myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
myBrowserFieldConfig.setProperty(BrowserFieldConfig.CONNECTION_FACTORY, _factory);
browserField = new BrowserField(myBrowserFieldConfig);
URLlink = "http://mydomain.com";
browserField.requestContent(URLlink);
我将 browserfield 用于从服务器打开 Web 应用程序的黑莓应用程序。我尝试将由网页的 href 链接触发的网络图像保存到 SDCard/blackberry 存储。这个怎么做?添加信息:当我添加 BrowserFieldConfig.CONTROLLER 时,我的 web 应用程序无法打开。如果我删除它,它工作得很好......