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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:09:03+00:00 2026-05-25T11:09:03+00:00

Internal links do not seem to be working in Android version 3 in my

  • 0

Internal links do not seem to be working in Android version 3 in my published app. My app targets Froyo at this point.

The app works fine on tons of phones, but my new Galaxy Tab can’t handle the internal links!! It can handle them within an html page, ie:

<a href="#faq">Go to faq</a>  <!-- goes to FAQ link -->

Goes to the tag lower on the same page:

<a name="faq" id="faq"></a>  

However from a another html file, ie the index page, the link no longer works in Honeycomb:

<a href="mainpage.html#faq">FAQ</a>  <!-- goes to error page -->

Also, if I go to an internal link, and from there follow a link to another page, then hit the back button, (it is overridden to go to previous webview page) you get the same error ie:

The webpage at file:///android_asset/folder/mainpage.html#faq might be temporarily    down or it may have moved permanently to a new web address

WTF! The webview was just on the page, but you hit back 1 second later, and it can’t find it. Nor can it link from another html page, but it all works fine in 1.x, 2.x, just not 3.1 (have not tried 3.0)

NOTE: I have seen this almost identical question:
android_asset not working on Honeycomb?
But there are no spaces in my asset path.

I have tried with and without the webclient, and tried the DOM and cache settings to no avail. Here is an example of what I currently have in oncreate:

        browser = new WebView(this);
//  browser = (WebView) findViewById(R.id.webkit);  // tried with XML and without
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.getSettings().setPluginsEnabled(true);
//  browser.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
//  browser.getSettings().setUseWideViewPort(true);
    browser.setBackgroundColor(Color.parseColor("#333333"));
    browser.setInitialScale(1);
    browser.getSettings().setBuiltInZoomControls(true);


    final Activity MyActivity = this;
    browser.setWebChromeClient(new WebChromeClient() {

        public void onProgressChanged(WebView view, int progress) {
            // Make the bar disappear after URL is loaded, and changes
            // string to Loading...

            setProgressBarIndeterminateVisibility(true);

            MyActivity.setTitle("  Loading . . . " + progress + "%");
            MyActivity.setProgress(progress * 100); // Make the bar

            if (progress == 100) {
                setTitle("  APP TITLE YADA YADA");
                setProgressBarIndeterminateVisibility(false);
            }
        }
    });
    browser.setWebViewClient(new WebViewClient() {
        @Override
        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
        {
            // Handle the error
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url)
        {
            view.loadUrl(url);  // note I tried with and without overriding this 
            return true;
        }

    });
    setContentView(browser);

    browser.loadUrl("file:///android_asset/folder/page.html");
  • 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-25T11:09:03+00:00Added an answer on May 25, 2026 at 11:09 am

    Here is my workaround code so the bug is transparent to the user.
    Define the WebViewClient for the browser, and include something like the following for onReceivedError:

            @Override
        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
        {
            if (failingUrl.contains("#")) {
                Log.v("LOG", "failing url:"+ failingUrl);
                final int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
                if (sdkVersion > Build.VERSION_CODES.GINGERBREAD) {
                    String[] temp;
                    temp = failingUrl.split("#");
                    view.loadUrl(temp[0]); // load page without internal link
    
                    try {
                        Thread.sleep(400);
                    } catch (InterruptedException e) {
    
                        e.printStackTrace();
                    }
                }
    
                view.loadUrl(failingUrl);  // try again
            } else {
                 view.loadUrl("file:///android_asset/tableofcontents.html");
            }
        }
        });
    

    This tricks the webview to first load the page without the #link, then sleep for .4 of a second, and then load the full URL again. I have chosen to do this trick for tablets only by sdkVersion. If there is any other error I load another page, the tableofcontents.html. This works to fix the problem on my Galaxy Tab.

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

Sidebar

Related Questions

I have an internal web app with an image at the top of the
I have a internal website that users log into. This data is saved as
My drupal site (internal) will not display the TinyMCE editor when using Google Chrome
This is my code: internal enum WindowsMessagesFlags { WM_EXITSIZEMOVE = 0x00000232, WM_DISPLAYCHANGE = 0x0000007e,
I've got the following regular expression that works fine on my testing server, but
In short, I'm working on a DurationPickerDialog that works similarly to how the DatePickerDialog
Although several thousand Emacs Lisp libraries exist, GNU Emacs, until version 24.1 did not
What I want to achieve: I have an online dictionary which works quite fine
I have set up intent filters to handle certain email links with my app.
I've got two options for this plugin. (1) nofollow all external links in content

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.