当我尝试下面的代码时,它会阻塞 UI 线程(我认为)它会加载一个空白页面。有人可以告诉我正确的实施方法是什么handleNavigationRequest
。我尝试实现它,但是当我尝试运行时,我得到一个handleNavigationRequest
必须是接口的错误。
这是代码
class BrowserFieldScreen extends MainScreen
{
public BrowserFieldScreen()
{
BrowserFieldConfig browserFieldConfig = new BrowserFC();
BrowserFieldListener browserFieldListener = new BrowserFL();
BrowserField browserField = new BrowserField(browserFieldConfig);
browserField.addListener(browserFieldListener);
ProtocolController controller = new ProtocolController(browserField) {
public void handleNavigationRequest(BrowserFieldRequest request) throws Exception {
}
};
browserField.getConfig().setProperty(BrowserFieldConfig.CONTROLLER, controller);
browserField.requestContent("http://meul-online.com");
super.add(browserField);
}