在我的应用程序,我展示在任何一个CustomTabsIntent或外部HTML网站的网页视图:Android浏览器切割的https:从完整的预选赛//方案
if (customTabsIntent != null) customTabsIntent.launchUrl(this, Uri.parse("http://some.where.com/site.html"));
else startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://some.where.com/site.html")));
但是HTML的风格已经是更新,但我的智能手机显示旧式(旧字体等)。
在* .html文件有参照的*的CSS:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href='https://my.site.com/assets/css/style.css' rel='stylesheet' type='text/css'>
</head>
在那*的CSS文件中,有引用的单个字体;例如: -
@font-face {
font-family: 'MyFontRegular';
src: url('https://www.openfont.org/assets/mail/fonts/MyFontWeb-Regular.woff') format('woff'),
url('https://www.openfont.org/assets/mail/fonts/MyFontWeb-Regular.eot') format('embedded-opentype');
}
正如我所说的,Chrome浏览器在我的智能手机不显示了引用的字体,因为它减少了HTTP://或https://开头关闭。 当我将该方案手动添加到地址栏中时,会显示正确的样式。
当我的android应用程序调用它时,如何在我的android浏览器的地址字段中强制使用https://方案?
好的,我发现它应该是https://some.where.com/site.html。浏览器使用some.where.com/site.html(不含https://)打开。当我在地址栏中手动添加“https://”时,它可以很好地工作 –
您可以发布WebView实施的代码吗?如果那是你正在使用的? – Destry