- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我需要导航到我的 Metro 应用程序中的 Internet 页面。我的网址是(示例)“http://www.foo.com/#/foo”。问题是 LaunchUriAsync 将 url 剪切为“http://www.foo.com”。
try
{
Uri uri = new Uri(item.UriCode);
await Launcher.LaunchUriAsync(uri);
}
catch (Exception exception)
{
//TODO
}
我哪里错了?问候。
更新:
我确定 uri = http://www.foo.com/#/foo .所以问题来自 LaunchUriAsync 。
最佳答案
我尝试使用相同的代码对您提到的 uri 进行硬编码请检查以下代码:
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
try
{
Uri uri = new Uri("http://www.foo.com/#/foo");
await Launcher.LaunchUriAsync(uri);
}
catch (Exception exception)
{
//TODO
}
}
输出如下图
我认为还有其他问题。可能与 item.UriCode
行有关,请检查。
关于c# - LaunchUriAsync 未导航到正确的 uri,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13967912/
我需要导航到我的 Metro 应用程序中的 Internet 页面。我的网址是(示例)“http://www.foo.com/#/foo”。问题是 LaunchUriAsync 将 url 剪切为“h
我正在尝试通过 LaunchUriAsync() 在 OnShareTargetActivated() 方法上调用我的应用程序,但它不起作用。 我在 appmanifest 中有一个名为“myapp”
根据标题,我正在通过 URI 调用运行一个应用程序,我想知道该应用程序何时完成运行并终止。该应用程序是第 3 方应用程序,它没有我可以使用的返回值。 最佳答案 I would like to know
我只想打开 Web 浏览器并通过单击按钮导航到预定义的网站。但是,我发现的所有内容都与 Windows Phone 8 和 Silverlight 有关,其中 Microsoft.Phone.Task
我正在构建一个用作 URI 共享目标的应用程序;它使用 URI,然后使用 URL 调用浏览器到我们的网站进行共享。我有使用共享目标示例的代码,但是当我在调试器之外时,Launcher.LaunchUr
所以我整晚都在早上看起来像个僵尸,试图弄清楚操作系统如何处理 NDEFLaunchApp 记录的 NFC 点击,我知道以下内容。 我很确定有一种解决方法可以让您从您的应用程序启动系统应用程序/第三方应
当用户单击 Toast 通知时,我尝试使用方法 LaunchUriAsync 打开具有特定 URL 的浏览器。 问题是应用程序抛出 System.InvalidOperationException:
我是一名优秀的程序员,十分优秀!