I am loading SWF file into Andriod.
I am trying with webview, but there is an error couldn't load plug-in
String text="<html>
" +
" <head>
" +
" <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
" +
" </head>
" +
" <body>
" +
"<h1>jvjhvjhv</h1>
"+
" <object width="215" height="140">
" +
" <param name="movie" value="airplane.swf">
" +
" <embed src="file:///android_asset/airplane.swf"
" +
" width="215" height="140">
" +
" </embed>
" +
" </object>
" +
" </body>
" +
"</html>";
private WebView mWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mWebView = (WebView)findViewById(R.id.web);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginState(WebSettings.PluginState.ON);
mWebView.getSettings().setAllowFileAccess(true);
//mWebView.setWebViewClient(new WebViewClient());
mWebView.setWebChromeClient(new WebChromeClient());
mWebView.getSettings().setUserAgentString("Mozilla/5.0 (Mobile; Android; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.0");
mWebView.loadData(text,"text/html","utf-8");
}
Can anyone give me an answer to load SWF file in android?
Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…