Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6070973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:59:39+00:00 2026-05-23T09:59:39+00:00

I try to load a .swf file from assets folder to a webview, but

  • 0

I try to load a .swf file from assets folder to a webview, but I am not able to display it.

Here is the 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 =
        "<object width=\"550\" height=\"400\"> <param name=\"movie\"   value=\"file:///android_asset/co.swf\"> <embed src=\"file:///android_asset/co.swf\" width=\"550\" height=\"400\"> </embed> </object>";
        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;
}

}

Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.androidpeople.view"
  android:versionCode="1"
  android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".WebViewExample"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>
<uses-sdk android:minSdkVersion="5" />

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest> 

Now I got a new error:

06-30 06:17:35.207: ERROR/MetadataRetrieverClient(33): failed to extract an album art
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:59:40+00:00Added an answer on May 23, 2026 at 9:59 am

    Please used below code

    String html =
    "<object width=\"550\" height=\"400\"> <param name=\"movie\" value=\"file:///android_asset/co.swf\"> <embed src=\"file:///android_asset/co.swf\" width=\"550\" height=\"400\"> </embed> </object>";
    String mimeType = "text/html";
    String encoding = "utf-8";
    wv.loadDataWithBaseURL("null", html, mimeType, encoding, "");
    

    OR

    Reefer this link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to load assets from an SWC into a SWF at compile
We try to convert from string to Byte[] using the following Java code: String
I have to load XML from external domain, so my code looks like this
When I try to load a js file externally I keep getting a 404
I need to use a DLL file from qsBarcode http://www.qsbarcode.de/en/index.htm (here is the download
I try to load image with processing.js using CoffeeScript and write this simple code:
I am using xml.net in web application When I try load xml through an
When I try to load a solution in Visual Studio 2008, it immediately closes.
I currently have issues in Webkit(Safari and Chrome) were I try to load dynamically
I am assigning ViewState[something] in Page Load of content page and when I try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.