gpt4 book ai didi

Android 如何在这样的 webview 中显示链接?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:26:31 26 4
gpt4 key购买 nike

有谁知道在 webview 中显示 URL 的方法吗

enter image description here

但在这里我得到像这样这里没有焦点和没有点击选项不起作用任何东西请给我一些建议..

enter image description here

此代码在 webview 中使用显示数据

 webview.getSettings().setJavaScriptEnabled(true);
webview.loadDataWithBaseURL(null, string, "text/html", "utf-8", null);

最佳答案

使用Linkify .

Spannable sp = new SpannableString(Html.fromHtml(string));
Linkify.addLinks(sp, Linkify.ALL);
final String html = "<body>" + Html.toHtml(sp) + "</body>";
webView.loadData(html, "text/html", "utf-8");

关于Android 如何在这样的 webview 中显示链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14576507/

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