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 4566854
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:50:51+00:00 2026-05-21T18:50:51+00:00

I am trying to show an html file in my assets folder but in

  • 0

I am trying to show an html file in my assets folder but in web view i am seeing white blank page. I got similar example from stackflow only.

 public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    final String mimeType="text/html";
    final String encoding="UTF-8";
    String htmlString="<html><body>";
    Document doc;
    WebView wv= new WebView(this);
    Elements link = null;


    setContentView(wv);
    try{
        InputStream in=getAssets().open("myweb.html");
        byte[] buffer= new byte[in.available()];
        in.read(buffer);
        in.close();
        wv.loadData(new String(buffer), mimeType, encoding);
    }
    catch(IOException e)
    {
        Log.d("MyWebView", e.toString());
    }
}
  • 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-21T18:50:52+00:00Added an answer on May 21, 2026 at 6:50 pm

    you can load the content of the web view using

    // add a webview with id @+id/the_webwiev to your main.xml layout file
    WebView wv = (WebView)findViewById(R.id.the_webview);
    wv.loadUrl("file:///android_asset/myweb.html");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add inline SVG to an HTML file, but it doesn't show
inside show.js.erb $('#viewport').html(<%= escape_javascript(render('show')) %>); I am trying to render the show view into
I'm trying to add some jQuery + ERB to a specific view: views/posts/show.html.erb (top
I'm trying to load a html file in my webview using this codes. but
I'm trying to show a HTML page with PHP right before it downloads a
I want to display a file content (HTML file) inside a web page using
I am trying to show a html file in a jeditorpane. The file is
I'm trying to show a list of links (in index.html) to text files in
I'm trying to download all png files contained in an html file. I have
In my index.html.erb file I'm trying to display the title to my object (a

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.