简体   繁体   English

如何在浏览器会话中从网页导航回Java应用程序?

[英]How to navigate back to the Java appliacation from a web page in Browser Session?

We are developing a Java application for BlackBerry. 我们正在为BlackBerry开发Java应用程序。 We have the home screen in which we have various links to open the different versions of the news pages. 我们有主屏幕,在其中有各种链接可以打开新闻页面的不同版本。 We have links in these news pages to open the various articles. 我们在这些新闻页面上有链接可以打开各种文章。 We need to create a href link in the web page which should act like the home button. 我们需要在网页中创建一个href链接,该链接应类似于主页按钮。 When the user clicks on this home button, the application should navigate back to the Home screen. 当用户单击此主页按钮时,应用程序应导航回到主页屏幕。 The web pages arer being created by us. 网页由我们创建。 So, we can embed any code. 因此,我们可以嵌入任何代码。 Thanks in advance. 提前致谢。

This took me awhile to figure out and to get working, but once I did, the concept seemed so simple. 这花了我一段时间才能弄清楚并开始工作,但是一旦我做到了,这个概念似乎就这么简单。 Look into BrowserContentProvider. 查看BrowserContentProvider。 If my memory serves, you can find an example of this in the SDK. 如果需要我帮忙的话,您可以在SDK中找到一个示例。 Essentially, you can register a BrowserContentProvider with your application. 本质上,您可以在应用程序中注册BrowserContentProvider。 Then, you set up your website link with a certain extension. 然后,您设置具有特定扩展名的网站链接。 When the BlackBerry browser doesn't know how to handle that extension, it will go around and "ask" if any other applications know how to handle it. 当BlackBerry浏览器不知道如何处理该扩展名时,它将绕开并“询问”是否有其他应用程序知道如何处理该扩展名。 Your application can then recognize it and request the foreground (to open on top of the browser). 然后,您的应用程序可以识别它并请求前台(在浏览器顶部打开)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM