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

  • Home
  • SEARCH
  • 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 8507723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:57:02+00:00 2026-06-11T02:57:02+00:00

I am attempting to contain a WebView within a PopupWindow. The WebView is to

  • 0

I am attempting to contain a WebView within a PopupWindow. The WebView is to display Wikipedia pages.

Interestingly, the WebView works as I intend when using the simulator. When I use the app on my test device (an original ASUS Transformer), instead of the Web Page displaying within the Popup, the popup comes up, my loader shows loading progress, but then the default web browser comes up to display the web page. Again, it works as intended in the simulator where the page displays within the Popup window. I have looked at many sites, including many many posts here on SO, and nothing I have tried works. I am hoping someone else has seen this in one of their app developments.

The code I have implemented for a setup of the button, PopupWindow, and WebView is:

WikiButton   = (ImageButton)findViewById(R.id.WikiButton);
htmlProgress = (ProgressBar)elemWebView.findViewById(R.id.htmlProgressBar);

htmlShowing  = -1;

// Necessary for the Info Popup window
infoWebViewPopup = new PopupWindow(infoWebView = inflater.inflate(R.layout.property_info_layout, null, false), 1105, 685, true);
infoWebViewPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
infoWebViewPopup.setFocusable(false);

infoWebHTMLView = (WebView)infoWebView.findViewById(R.id.infoWebHTMLView);
WebSettings mySettingsInfo = elemWebHTMLView.getSettings();
mySettingsInfo.setJavaScriptEnabled(true);

The Button Action Code is:

WikiButton.setOnClickListener(new View.OnClickListener(){
    infoWebHTMLView.clearView();

    String urlToGet = "http://en.wikipedia.org/wiki/" + "SOME OTHER STRING HERE";

    // Load the URL into the web view
    infoWebHTMLView.loadUrl(urlToGet);

    // Calculate posX and posY for placement
    infoWebViewPopup.setOutsideTouchable(false);
    infoWebViewPopup.showAtLocation(findViewById(R.id.properties_view), Gravity.LEFT | Gravity.TOP, posX, posY);
}

Other code I have implemented for the WebView:

infoWebHTMLView.setWebChromeClient(new WebChromeClient() {
    public boolean shouldOverrideUrlLoading(WebView view, String url){
        view.loadUrl(url);

        return true;
    }

    public void onProgressChanged(WebView view, int progress) {
        elemWebHTMLView.invalidate();

        htmlProgress.setProgress(progress);

        if(progress >= 100){
            htmlProgress.setVisibility(View.INVISIBLE);
        }else{
            htmlProgress.setVisibility(View.VISIBLE);
        }
    }
});

The PopupWindow, WebView, and Button have all been defined in XML files.

ANY help would be appreciated, and thanks much.

  • 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-11T02:57:03+00:00Added an answer on June 11, 2026 at 2:57 am

    You should be using WebViewClient, not WebChromeClient.

    infoWebHTMLView.setWebViewClient(new WebViewClient() {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
    });
    

    Make sure to add @Override annotations when you’re overriding methods. You’ll get an error if you thought you were overriding a method but it actually doesn’t exist.

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

Sidebar

Related Questions

I am including HTML pages in an iPad magazine app using WebView (Woodwing Reader
I'm attempting to pass the contents of a file into a Webview. Using the
I'm developing an Android app which uses a webview to display a webpage. Most
Attempting to use the data series from this example no longer passes the JSONLint
Attempting to use XStream's JavaBeanConverter and running into an issue. Most likely I'm missng
Attempting/struggling to get registration and sign-up working within an active admin project. I have
I am attempting to persist objects that contain some large Serializable types. I want
I am attempting to set a revprop using svnadmin setrevprop /path/to/repos propname propfile -r
I'm attempting to make use of configuration transformations in a continuous integration environment. I
I am attempting to find the first number in the Fibonacci sequence to contain

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.