Note that there are some explanatory texts on larger screens.

plurals
  1. POFlash file does not display in webview
    text
    copied!<p>I try to load a .swf file from assets folder to a webview, but I am not able to display it.</p> <p>Here is the code: </p> <pre class="lang-java prettyprint-override"><code>package com.androidpeople.view; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; public class WebViewExample extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String html = "&lt;object width=\"550\" height=\"400\"&gt; &lt;param name=\"movie\" value=\"file:///android_asset/co.swf\"&gt; &lt;embed src=\"file:///android_asset/co.swf\" width=\"550\" height=\"400\"&gt; &lt;/embed&gt; &lt;/object&gt;"; String mimeType = "text/html"; String encoding = "utf-8"; ; WebView wv=(WebView) findViewById(R.id.webview); wv.getSettings().setJavaScriptEnabled(true); //wv.getSettings().setPluginsEnabled(true); wv.loadDataWithBaseURL("null", html, mimeType, encoding, ""); wv.setWebViewClient(new HelloWebViewClient()); } } package com.androidpeople.view; import android.webkit.WebView; import android.webkit.WebViewClient; public class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } </code></pre> <p>Manifest:</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.androidpeople.view" android:versionCode="1" android:versionName="1.0"&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".WebViewExample" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion="5" /&gt; &lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt; &lt;/manifest&gt; </code></pre> <p>Now I got a new error:</p> <pre class="lang-none prettyprint-override"><code>06-30 06:17:35.207: ERROR/MetadataRetrieverClient(33): failed to extract an album art </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload