OpenUrl在编辑和运行时工作,但在构建Android后不起作用
因此,我正在尝试制作一个按钮,该按钮在单击时打开网页。这是该功能的代码:
public void ToHyperLink()
{
string theURL = parentButton.GetComponent<BLButton>().btnRefObj.GetComponent<HyperlinkAttri>().prodURL;
Application.OpenURL(theURL);
}
在我的PC上测试它时,这可以很好地工作,但是一旦它构建到我的Android手机,它就会停止工作。
So I am trying to make a button that opens up to a webpage when clicked. Here is the code for the function:
public void ToHyperLink()
{
string theURL = parentButton.GetComponent<BLButton>().btnRefObj.GetComponent<HyperlinkAttri>().prodURL;
Application.OpenURL(theURL);
}
The URL is passed through the inspector like this:
This works perfectly fine when testing it on my PC, but once it is built to my Android phone it stops working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚测试了它。
application.openurl(“ http://google.com”);
直接工作。直接进行链接并检查是否到了。然后单击构建和运行,然后检查是否有任何错误。Just tested it.
Application.OpenURL("http://google.com");
works fine.Give the link directly and check if it is coming.You can install Android Logcat from package manager and connect android phone via usb and click build and run and check for any errors.