【问题标题】:Android load html data into chrome custom tabsAndroid 将 html 数据加载到 chrome 自定义选项卡中
【发布时间】:2017-03-25 22:15:43
【问题描述】:

我想在我的应用中使用 chrome 自定义标签。我找到了如何将 url 中的数据加载到选项卡中,但我没有找到如何使用 html-tags 从字符串值加载数据。如何从 webview-example 制作类似的功能:

webViewContent.loadDataWithBaseURL(null, htmlText, "text/html", "UTF-8", null);

在 chrome 自定义标签中?

【问题讨论】:

  • Chrome 自定义标签无法做到这一点

标签: android html webview google-chrome-devtools


【解决方案1】:

无法直接将具有 file:// url 的 HTML 字符串或本地 HTML 文件加载到 chrome 自定义选项卡。

但是您可以实现本地服务器以在自定义 chrome 选项卡中呈现离线 html 内容。参考以下网址。

https://bitbucket.org/snippets/pkumarad/qAk6x

【讨论】:

    猜你喜欢
    • 2021-04-11
    • 2016-11-05
    • 2022-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-28
    • 1970-01-01
    相关资源
    最近更新 更多