×
Namespaces

Variants
Actions

在web浏览器中打开html链接

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

兼容于
平台安全性
需要的签名: Self-Signed
能力: None

文章
翻译:
hoolee
最后由 hamishwillee 在 23 Aug 2012 编辑
  • 详细描述

下列代码演示了如何在web浏览器中打开一个html链接。

  • MMP文件

需要下列链接库和能力

CAPABILITY None
LIBRARY apmime.lib // TDataType
LIBRARY apgrfx.lib // RApaLsSession
  • 头文件
#include <APGCLI.H>
#include <APMSTD.H>
  • 源文件
// Create session
RApaLsSession session;
User::LeaveIfError(session.Connect());
CleanupClosePushL(session);
 
// Gets the default application UID for for the given MIME type
TUid uid;
TDataType dataType(_L8("text/html"));
session.AppForDataType(dataType,uid);
 
// Runs the default application using the dataType
TThreadId threadId;
User::LeaveIfError(session.StartDocument(_L("http://www.google.com"), dataType, threadId));
 
CleanupStack::PopAndDestroy(); // session
  • 后记

执行后会在web浏览器中打开www.google.com网址

Version Hint

Windows Phone: [[Category:Windows Phone]]
[[Category:Windows Phone 7.5]]
[[Category:Windows Phone 8]]

Nokia Asha: [[Category:Nokia Asha]]
[[Category:Nokia Asha Platform 1.0]]

Series 40: [[Category:Series 40]]
[[Category:Series 40 1st Edition]] [[Category:Series 40 2nd Edition]]
[[Category:Series 40 3rd Edition (initial release)]] [[Category:Series 40 3rd Edition FP1]] [[Category:Series 40 3rd Edition FP2]]
[[Category:Series 40 5th Edition (initial release)]] [[Category:Series 40 5th Edition FP1]]
[[Category:Series 40 6th Edition (initial release)]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 Developer Platform 2.0]]

Symbian: [[Category:Symbian]]
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
[[Category:S60 5th Edition]]
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

This page was last modified on 23 August 2012, at 08:34.
57 page views in the last 30 days.
×