Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ok, my apologies for the first answer. I think <code>DOCTYPE</code> was a red herring (but I didn't have your Java <strong>code</strong> at the time).</p> <p>I see a few potential problems:</p> <h2>Network Connectivity</h2> <p>First, as is always the case, make sure you have network connectivity for your device, or simulator. That may include the MDS simulator running. You can always test connectivity with the normal <strong>Browser</strong> app, checking a website you know to be running. I believe that if you have a total lack of connectivity (i.e. network disabled), then you will get your frames showing just the text / URLs. However, I believe it will also have something like this:</p> <blockquote> <p>Could not select proper Transport Descriptor for: <a href="http://www.penny-arcade.com" rel="nofollow noreferrer">http://www.penny-arcade.com</a></p> </blockquote> <p>instead of showing <code>null</code>, as you show.</p> <h2>Adding BrowserField</h2> <p>Next, I think <a href="https://stackoverflow.com/a/12578692/119114">there is a problem</a> with you asking the browser field to display content <strong>before</strong> you've added the field. Simply switch the order of those two lines of code to this:</p> <pre class="lang-java prettyprint-override"><code> add(browserField); try { String embeddedLinkFrame = readTextFile("frame.html"); browserField.displayContent(embeddedLinkFrame, "http://localhost"); } catch (Exception e) { System.out.println(e.getMessage()); } </code></pre> <p>I believe the behaviour if you have these lines out of order, however, is just to get a <strong>blank</strong> browser field.</p> <h2>Viewport Properties</h2> <p>Lastly, I would not recommend setting page properties programmatically, as you've done. Although this is not going to keep your page from displaying, I'd recommend putting those properties in HTML <code>meta</code> elements:</p> <pre class="lang-html prettyprint-override"><code>&lt;head&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"&gt; &lt;/head&gt; </code></pre> <p><a href="http://developer.blackberry.com/html5/documentation/html_best_practices.html" rel="nofollow noreferrer">Source: BlackBerry.com</a></p> <hr> <h2>Update: Protocol Controller</h2> <p>Unfortunately, my simulator is acting up, and declining to support hot-swap right now. So, it's hard for me to run many times, and collect decisive results. But, it looks to me like removing your <code>ProtocolController</code> object prevents this problem from happening for me. (maybe you can clarify <em>why</em> you're using the protocol controller in this situation?). <a href="https://stackoverflow.com/a/5546475/119114">If this answer was a motivation</a>, you might look carefully at the poster's full comments about it's usefulness.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload