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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:15:57+00:00 2026-05-26T22:15:57+00:00

String htmlCodeGoesHere=<div id=\fb-root\></div>+ <script>(function(d, s, id) {+ var js, fjs = d.getElementsByTagName(s)[0];+ if (d.getElementById(id))

  • 0
String htmlCodeGoesHere="<div id=\"fb-root\"></div>"+
"<script>(function(d, s, id) {"+
  "var js, fjs = d.getElementsByTagName(s)[0];"+
  "if (d.getElementById(id)) {return;}"+
  "js = d.createElement(s); js.id = id;"+
  "js.src = \"//connect.facebook.net/en_US/all.js#xfbml=1&appId="xxxxxxxxxxx"\";"+
  "fjs.parentNode.insertBefore(js, fjs);"+
"}(document, 'script', 'facebook-jssdk'));</script>"+
"<div class=\"fb-like\" data-href=\"http://www.facebook.com/xxxxxxxxx\" data-send=\"true\" data-width=\"450\" data-show-faces=\"true\"></div>";

WebView webview=new WebView(this);
            webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
            webview.getSettings().setJavaScriptEnabled(true);
            webview.getSettings().setSavePassword(false);
            webview.getSettings().setBuiltInZoomControls(false);
            webview.getSettings().setUseWideViewPort(true);
            //webview.getSettings().setLoadWithOverviewMode(true);
            webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
            webview.setHorizontalScrollBarEnabled(false);
            webview.setBackgroundColor(0xff2e2e2e);
            webview.loadDataWithBaseURL(null, htmlCodeGoesHere, "text/html", "utf-8", null);

this.addContentView(webview,params);

trying to add js and div to webview. showing a blank screen.

i am trying to do like functionality for android app. please help me.

  • 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-26T22:15:58+00:00Added an answer on May 26, 2026 at 10:15 pm

    Check the output of your logcat and add something like this:

        /* WebChromeClient must be set BEFORE calling loadUrl! */
        view.setWebChromeClient(new WebChromeClient() {
    
            @Override
            public boolean onJsAlert(WebView view, String url, String message, final android.webkit.JsResult result) {
                Log.e("js ", message);
                return false;
            }
        });/ // for debugging convenience.
    

    to also log the javascript errors to logcat.

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

Sidebar

Related Questions

string s = <script type=text/javascript src=/stepcarousel.js></script> How can I get the data inside the
String.format = function() { var s = arguments[0]; for (var i = 0; i
string[] filesOfType1 = GetFileList1(); string[] filesOfType2 = GetFileList2(); var cookieMap = new Dictionary<string, CookieContainer>();
string x; foreach(var item in collection) { x += item+,; } can I write
string EV_HOME = System.Environment.GetEnvironmentVariable(EV_HOME); string myFilePath = EV_HOME + \\MyFolder\\MySubFolder; Suppose EV_HOME return C:\myprogram\leanrning\anotherfolder
String DocLocation = System.AppDomain.CurrentDomain.BaseDirectory + Files/test.pdf; // or String DocLocation = Url.Content(~/Files/test.pdf); var document
String html = Jsoup.connect(www.example.com).get().html(); Scanner in = new Scanner(html); String links ; while(in.hasNext()){ String
String link = javascript:document.forms[0].submit() onClick=\return processParams( + classOid + )\ ; classbreadCrumbSelect.add( + className
string message = CommonFunctions.SanitiseInput(context.Request.QueryString[msg]); And the function is defined as: // Sanitise input public
string sqlQuery = unknown; I need to write a function which receives a sql

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.