我正在尝试处理 BrowserField
中的事件当用户实际点击链接时。
我学习了BrowserFieldListener
,尝试了它的 documentCreated()
方法,但在页面开始加载时会给我一个响应。我想要在用户单击 browserField 中的链接时触发。
我在这里缺少什么?
最佳答案
覆盖 handleNavigationRequest() ProtocolController 之类的
ProtocolController controller = new ProtocolController(browserField) {
public void handleNavigationRequest(BrowserFieldRequest request) throws Exception {
/*
Here you get the redirection link using
request.getURL()
and do what you want to do
*/
// to display url in browserfield use
InputConnection inputConnection = handleResourceRequest(request);
browserField.displayContent(inputConnection, request.getURL());
}
};
browserField.getConfig().setProperty(BrowserFieldConfig.CONTROLLER, controller);
关于Blackberry 5.0 - BrowserField 句柄链接被点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11924182/