BlackBerry 10 - 调用浏览器

时间:2013-01-25 21:48:45

标签: blackberry-10

是否有任何调用BlackBerry 10浏览器在onclick事件中打开的示例?我正在尝试使用c ++使用本机SDK执行此操作。

由于

2 个答案:

答案 0 :(得分:5)

HTML5

取自样本here

function openWebLink() {
    // open web link - allows the system to choose an appropriate target that handles http://
    blackberry.invoke.invoke({
        uri: "http://www.blackberry.com"
    }, onInvokeSuccess, onInvokeError);
}

function openWebLinkInBrowser() {
    // open web link in browser
    blackberry.invoke.invoke({
        target: "sys.browser",
        uri: "http://www.blackberry.com"
    }, onInvokeSuccess, onInvokeError);
}

本地

使用以下attributes ...

级联

有一个示例here

使用navigator_invoke.h

navigator_invoke_invocation_t *invoke = NULL;
navigator_invoke_invocation_create(&invoke);

navigator_invoke_invocation_set_target(invoke, "sys.browser");
navigator_invoke_invocation_set_action(invoke, "bb.action.OPEN");
navigator_invoke_invocation_set_uri(invoke, "http://stackoverflow.com");

navigator_invoke_invocation_send(invoke);
navigator_invoke_invocation_destroy(invoke);

答案 1 :(得分:2)

包含Qt库并致电

Qt.openUrlExternally(targetUri);