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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:44:43+00:00 2026-06-18T14:44:43+00:00

In my Android app I have a WebView element with a custom WebViewClient. It

  • 0

In my Android app I have a WebView element with a custom WebViewClient. It shows an error page via onReceivedError(), and it returns false for shouldOverrideUrlLoading().

I would expect the WebView now to open links in the external browser, not in the WebView itself, as it is explained in many other posts on SO. However, this does not work. It still opens every link inside the WebView.

Has it maybe something to do with the fact that I don’t load the content via loadUrl() but via loadData() and pass an html-string?

  • 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-06-18T14:44:44+00:00Added an answer on June 18, 2026 at 2:44 pm

    You must use an intent to launch the url in the external browser. Method shouldOverrideUrlLoading() is a good candidate:

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        Context context = view.getContext();
        Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    
        // Launch default browser
        context.startActivity(browserIntent);
    
        return true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created an online store within an android app in webview but have one
I've an android-app (Android SDK 10) with a WebView. On that WebView I have
I have an Android app, which uses an embedded PhoneGap WebView . I've successfully
I have created an android app that is using a custom-rolled authentication method by
I have an android app that register a custom url scheme (let's say app://)
In my android app I have a webview : <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have a web page stored in my res/raw folder in android app. I
I have a Android WebView app and it has YouTube videos embedded in it.
I have an Android app, which contains a WebView, and I would like to
In my Android app, I have need to show a webpage in a WebView,

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.