gpt4 book ai didi

android - 从 Android TV (Oreo) 中的 channel 点击后打开应用

转载 作者:行者123 更新时间:2023-11-29 23:14:23 25 4
gpt4 key购买 nike

在这张图片中:

enter image description here

我检查过:

  • 1 号和 3 号:可以点击并打开

在数字 3 中,它们是应用程序,

我也在开发自己的应用程序,可以在数字 3 中显示。

但是我的应用无法点击打开,

请建议我需要在何处定义哪个属性,以便让我的应用程序可以点击并直接打开应用程序?

谢谢,

最佳答案

经过一些研究,我找到了this Document做。

  • 必须使用:setAppLinkIntentUri() 方法

  • 重新安装应用

如下代码

// NOTE : THESE INFO MUST MATCH WITH DATA IN MANIFEST.XML
String SCHEME = "xxx";
String HOST = "xxx";
String PATH = "xxx";

ComponentName componentName = new ComponentName(context, MainActivity.class.getName());
String channelInputId = TvContractCompat.buildInputId(componentName);

// Design Channel Data on Launcher in here
Channel channel = new Channel.Builder()
.setDisplayName(mContext.getString(R.string.mv_hot_title))
.setType(TvContractCompat.Channels.TYPE_PREVIEW)
.setInputId(channelInputId)
.setAppLinkIntentUri(Uri.parse(SCHEME + "://" + HOST + "/" + PATH))
.build();

关于android - 从 Android TV (Oreo) 中的 channel 点击后打开应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55584238/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com