Blackberry BrowserField white empty page issue

限于喜欢 提交于 2019-12-11 02:06:45

问题


Hi i want to show html content in BrowserField. I used the code blove to do this but i only see white empty page.

BrowserField demo = new BrowserField(); 
String res="<html><body><p>demo</p></body></html>"; 

demo.displayContent(res, "http://localhost");

Sometimes it shows my page correctly with css fonts but sometimes it does not show anything.

What is the problem in my code?


回答1:


If you look at this BlackBerry example,

they make sure to add() the BrowserField to its parent Manager before calling displayContent().

I don't know if you just omitted that line of code to shorten your question, if you're missing the call to add() entirely, or if you put it after the call to displayContent(). But, try doing it in the order listed in the BlackBerry example, and let me know if that works.

BrowserField demo = new BrowserField(); 
add(demo);
String res="<html><body><p>demo</p></body></html>"; 
demo.displayContent(res, "http://localhost");


来源:https://stackoverflow.com/questions/12578176/blackberry-browserfield-white-empty-page-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!