android - 如果 webview 中没有可用的 favicon,则显示 favicon-default.png

标签 android webview error-handling favicon

好的,所以现在我管理了如何在 webview 中处理网站图标。

但是如果我的 webview 没有收到 favicon 怎么办?我想提供一个名为 favicon-default.png 的可绘制对象!

这该怎么做?在哪里?

最佳答案

如果您的 webview没有收到网站图标,请调用 getResource().getDrawable(R.drawable.favicon_default) .并且请避免在可绘制名称中使用“-”。

关于android - 如果 webview 中没有可用的 favicon,则显示 favicon-default.png,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44730247/

相关文章:

android - relativeLayout 设置为 wrap_content 与 alignParentRight?

Android WebView css 行高渲染错误

PHP 得到警告和错误信息?

android - 如何禁用我的 Android 应用 WebView 字体的设备字体大小更改

JavaScript 无法在 Android 中运行

error-handling - zsh 在 glob 失败中幸存下来

vb.net - 对象变量或带有 block 变量的未设置错误vb.net

android - 尝试以编程方式执行单击不可见的 Recycler View 项时出现空指针异常

java - 使用 JNI 从 Android 应用程序向 C++ 发送字符串

android - 每个项目都带有进度条的 ListView ?