Exemplo n.º 1
0
  /**
   * Load an URL in the device's browser application.
   *
   * @param args JSONArry of arguments for the action.
   * @return a PluginResult
   */
  private PluginResult openExternal(JSONArray args) {
    try {
      String url = args.getString(0);

      BrowserSession session = Browser.getDefaultSession();
      session.displayPage(url);
    } catch (JSONException e) {
      return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
    }

    return new PluginResult(PluginResult.Status.OK, "");
  }
Exemplo n.º 2
0
 private void openWeb(String url) {
   BrowserSession bs = Browser.getDefaultSession();
   bs.displayPage(url);
   bs.showBrowser();
 }