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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:25:59+00:00 2026-05-25T01:25:59+00:00

I have a WebView into which I’m loading the facebook sharer php page. This

  • 0

I have a WebView into which I’m loading the facebook sharer php page. This page doesn’t have any form of confirmation, it simply closes the window once the user has either shared or cancelled.

Since it is loaded into a web view there is nothing to “close” perse, so, I need to detect the window trying to close and act on that callback.

From my various searches it appears that the way to handle this is via a WebChromeClient. So, I’m attempting the following, but the callback is never called. I am obviously missing something, but don’t know what. It *feels like the onCloseWindow event should be Overriden, but that causes eclipse to complain (reasonably) that I need to super the instance, which the documentation doesn’t seem to suggest is possible.

All help appreciated.

[EDIT] oh, and I just tried swapping the order of the actions, setting the WebChromeClient before calling the url, and (as I expected) that didn’t alter the behavior in any way.

webview.getSettings().setJavaScriptEnabled(true);
    webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); 
    webview.setWebViewClient(new WebViewClient()); 
    webview.loadUrl("http://www.facebook.com/sharer/sharer.php?u=http://EXTRACTED.com?img_id=abc");// + getIntent().getStringExtra("userId"));
    WebChromeClient wbc = new WebChromeClient(){

        public void onCloseWindow(Window w){
            Log.d(TAG, "Window trying to close");
        }
    };

    webview.setWebChromeClient(wbc);
  • 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-25T01:26:00+00:00Added an answer on May 25, 2026 at 1:26 am

    Whats wrong with:

       public void onCloseWindow(WebView w){
            super.onCloseWindow(w);
            Log.d(TAG, "Window trying to close");
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WebView into which I'm loading a local HTML page with some
I have some problem with the injecting of my cookie into login.php page. This
I have the following code which loads and html file into a webview -
Cocoa app, SnowLeopard I have a WebView in to which I'm loading HTML (essentially
I have a login.jsp page which contains a login form. Once logged in the
I have a Picture pic = webView.capturePicture(); which is potentially huge and needs to
I have written a HTML page which has following code. <div id=adsListContainer style=margin: 5px;>
The documentation for WebView.emulateShiftHeld() says: Use this method to put the WebView into text
I have a webview in my iPhone application, and I also have some html
I have a Cocoa app that uses a WebView to display an HTML interface.

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.