我是初学者黑莓的应用程序开发。如何在blackberry-eclipse应用程序中使用html资源?
我已经成功安装了黑莓插件eclipse。我的第一个应用程序需要从我创建的名为“assets”的文件夹中加载我的项目中的html文件。所以我怎样才能加载HTML文件“assets/index.html”?
public static void main(String[] args)
{
// Create a new instance of the application and make the currently
// running thread the application's event dispatch thread.
Ramadanclass theApp = new Ramadanclass();
theApp.enterEventDispatcher();
}
mainscreen:
public final class Ramadan extends MainScreen
{
public Ramadan()
{
setTitle("Ramadan");
}
}
编辑:我的尝试:
BrowserField myBrowserField = new BrowserField();
add(myBrowserField);
myBrowserField.requestContent("assets/index.html");
其中有此错误
资产/指数没有导航请求处理。 html
你是什么意思的“呼叫”。你想访问它的内容,还是显示它? – Kevin
我想显示html页面 – Myworld
你可以使用'BrowserField',它的'displayContent'方法可以把你的html作为参数。尽管我现在不想发布答案,但是太忙了,实际上并没有试用它。 – Kevin