语言

Menu
Sites
Language
Hyperlink in TV App

 

Hi all,

is there a way to have an hyperlink (button or label) that open a URL with the web browser in a tv app?

I could not find any example on that, I tried a simple button calling Launcher,OpenAsync(url) (from Xamarin essential) but the app crashed(in emulator as well).

Thanks for your help.

 

查看选择的答案

响应

1 回复
Mark as answer
Tizen .NET

Hi,
When calling AppControl.SendLaunchRequest with the code below, AppNotFoundException exception occurs on Samsung TV emulator because there's no app to handle this app control. (FYI, web browser app is not provided in Samsung TV emulator)
However, it works well on Samsung Smart TV device.
There seems to be no way to check it on Samsung TV emulator.
For further questions related to Samsung TV emulator, please contact samsung tech support.
Thanks.

<privileges>
    <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
</privileges>

<ContentPage.Content>    
    <StackLayout>
        <Button x:Name="btn" Text="AppControl-View" Clicked="btn_Clicked" FontSize="Large"/>
        <Label x:Name="result" Text="AppControl Test" FontSize="Large" />
    </StackLayout>
</ContentPage.Content>

private void btn_Clicked(object sender, EventArgs e)
{
    try
    {
        var control = new AppControl()
        {
            Operation = AppControlOperations.View,
            Uri = "http://www.google.com"
        };
        AppControl.SendLaunchRequest(control);
    }
    catch (Exception ex)
    {
        result.Text = "[Error] " + ex.GetType() + ", " + ex.Message + ", " + ex.Source + ", " + ex.StackTrace;
    }
}