黑莓推出原生的网页浏览器 [英] Blackberry launch native web browser
本文介绍了黑莓推出原生的网页浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎样可以打开黑莓手机网址?
在J2ME中我使用:
How can I open a URL from BlackBerry ? in J2ME I am using:
this.platformRequest("http://www.google.com");
我怎么能这样做在BlackBerry?
How can I do this on BlackBerry?
推荐答案
如果要启动你可以使用浏览器会话:
If you want to launch a browser session you would use:
Browser.getDefaultSession().displayPage("http://www.google.com");
如果您要打开,然后读取处理自己返回的数据:
If you want to open, and then read the returned data for processing yourself:
HttpConnection google = (HttpConnection)javax.microedition.io.Connector.open("http://www.google.com");
int rc = google.getResponceCode();
...
InputStream is = google.openInputStream();
您确实需要确保处理连接和返回的数据不会发生在事件线程或BlackBerry将挂起。
You do need to make sure that processing the connection and returned data does not happen on the event thread or your blackberry will hang.
这篇关于黑莓推出原生的网页浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文