cocos2d-x中打开网页ios、android平台
void
FileOperation::linkToFull()
{
[[UIApplication
sharedApplication]openURL:[NSURL
URLWithString:@"http://itunes.apple.com/us/artist/xxxxx/xxxxxx"]];
}
public
static
void
openUrl(){
if(context==null)
return
;
Intent
it
=
new
Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.xxxx.cn/2011-08-01-04-04-50.html"));
it.setClassName("com.android.browser",
"com.android.browser.BrowserActivity");
context.startActivity(it);
return
;
}
原文地址:在cocos2d-x中打开网页 iOS、Android 平台
作者:yaoh
iOS中
{
}
Android中:
在C++中调用openUrl函数
要把函数加入到
Cocos2dxActivity.java中