是否有任何调用BlackBerry 10浏览器在onclick
事件中打开的示例?我正在尝试使用c ++使用本机SDK执行此操作。
由于
答案 0 :(得分:5)
取自样本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_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);