我已经经历了怪异的行为的大量使用WebView中Android,我不知道为什么有之间那么多diffrences WebView和Browser安装在每台手机上?
举个例子,我已经开发了一些应用程序,必须要显示HTML的内容,这无论是包含jquery-mobile,flash,javascript,YouTube嵌入式等.所以我在里面显示这些页面时遇到了很多问题WebViews.它们根本不会显示,只是空白,视频无法播放等等.奇怪的是,如果在Browser手机上安装打开它们,它们可以正常工作.我启用了JavaScript,我尝试了不同WebSettings,我已经设置WebChromeClient并WebViewClient寻找javascript错误......但没有任何效果.
所以我得出结论,该WebView组件Browser与手机上安装的应用程序完全不同.我想每个制造商都会自己Browser支持尽可能多的页面,而WebView剩下的就是标准的,包括在内Android SDK.
我对吗?或者还有其他原因/解释?谢谢.
编辑: @ondoteam建议的所有内容都已启用并暂时设置.我不再有那些网站的引用,无论如何都是内部的.
我正在尝试在webview中播放html5视频并且需要 setPluginsEnabled
WebView.getSettings().setPluginsEnabled
Run Code Online (Sandbox Code Playgroud)
但它并不存在于对象中.问题是什么 ?
这是我的代码:
package com.example.arachim;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends Activity {
WebView view;
//@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
view = new WebView(this);
String url= new String("http://broken-links.com/tests/video/");
WebChromeClient chromeClient = new WebChromeClient();
WebViewClient wvc = new WebViewClient();
view.setWebChromeClient(chromeClient);
view.setWebViewClient(wvc);
view.getSettings().setJavaScriptEnabled(true);
view.getSettings().setP
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present. …Run Code Online (Sandbox Code Playgroud) 可能重复:
将SWF加载到WebView中
我有一个.swf文件,我想将其打开成webview,并且还想在webview中播放加载的flash游戏.我怎么做?

我在webview中编码形式的swf文件而不是时钟.
我正在开发一个Android 3.0平板电脑的应用程序,它应该在WebView中播放swf文件.首先,我尝试从设备打开swf文件,而不是通过互联网,没有运气.WebView显示,但在WebView中我只能看到一个黑屏(右侧有3-4 px宽的白线).如果我将相同的URL加载到设备浏览器,则Flash文件可以正常播放.我想我在WebView设置上遗漏了一些东西,但经过几个小时的搜索和谷歌搜索后,我仍然不知道是什么.
Java代码:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.presentation);
presentationWebView = (WebView) findViewById(R.id.presentation_webview);
presentationWebView.getSettings().setJavaScriptEnabled(true);
presentationWebView.getSettings().setPluginsEnabled(true);
presentationWebView.getSettings().setAllowFileAccess(true);
presentationWebView.loadUrl("http://my_domain/fileName.swf");
Run Code Online (Sandbox Code Playgroud)
}
presentation.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:id = "@+id/presentation_webview"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
谢谢你非常怀疑任何答案.Ripityom