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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:41:20+00:00 2026-06-07T16:41:20+00:00

I want to add this code to my java file: webView.setWebViewClient(new WebViewClient(){ public boolean

  • 0

I want to add this code to my java file:

webView.setWebViewClient(new WebViewClient(){
   public boolean shouldOverrideUrlLoading(WebView view, String url) {
       if (url != null && url.startsWith("http://")) {
           view.getContext().startActivity(
               new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
           return true;
       } else {
           return false;
       }
   }
}

But I don’t know where. This is my java file:
package sherdle.donald.duck.app;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class WebPageLoader extends Activity
{
WebView webview;

final Activity activity = this;

@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webview.getSettings().setSupportMultipleWindows(true);
webview.getSettings().setPluginsEnabled(true);

webview.setWebChromeClient(new WebChromeClient() {
    public void onProgressChanged(WebView view, int progress)
    {
        activity.setTitle("Loading...");
        activity.setProgress(progress * 100);

        if(progress == 100)
            activity.setTitle(R.string.app_name);
    }
 });

 webview.setWebViewClient(new WebViewClient() {


    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url)
    {
        view.loadUrl(url);
        return true;

    }
   });



 webview.loadUrl("http://www.sherdle.com/apphosting/dd");
 }

 @Override
 public void onBackPressed (){
    if(webview.canGoBack()) webview.goBack();
    else super.onBackPressed();
 }
 }

I’m new to android and I need much help for everything I do. Thanks for your help.

I’ve got already this now:
package sherdle.donald.duck.app;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class WebPageLoader extends Activity
{
WebView webview;

final Activity activity = this;

@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webview.getSettings().setSupportMultipleWindows(true);
webview.getSettings().setPluginsEnabled(true);

 webview.setWebChromeClient(new WebChromeClient() {
    public void onProgressChanged(WebView view, int progress)
    {
        activity.setTitle("Loading...");
        activity.setProgress(progress * 100);

        if(progress == 100)
            activity.setTitle(R.string.app_name);
    }
 });



 webview.setWebViewClient(new WebViewClient() {


    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url)
    {
        view.loadUrl(url);
        return true;

    }
 });

 webview.setWebChromeClient(new WebChromeClient(){
   public boolean shouldOverrideUrlLoading(WebView view, String url) {
       if (url != null && url.startsWith("http://")) {
           view.getContext().startActivity(
               new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
           return true;
       } else {
           return false;
       }
   }

  webview.loadUrl("http://www.sherdle.com/apphosting/dd");
  }



 @Override
 public void onBackPressed (){
    if(webview.canGoBack()) webview.goBack();
    else super.onBackPressed();
 }
 }

But I get this error on my LoadUrl line:
Multiple markers at this line
– Syntax error, insert “AssignmentOperator Expression” to complete
Expression
– Syntax error, insert “;” to complete FieldDeclaration
– Syntax error, insert “)” to complete MethodInvocation
– Syntax error, insert “}” to complete ClassBody
– Syntax error, insert “;” to complete Statement
– Syntax error on token(s), misplaced construct(s)

  • 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-07T16:41:21+00:00Added an answer on June 7, 2026 at 4:41 pm

    use in this way

        @Override
    public void onCreate(Bundle savedInstanceState)
    {
    super.onCreate(savedInstanceState);
    this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
    setContentView(R.layout.main);
    webview = (WebView) findViewById(R.id.webview);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    webview.getSettings().setSupportMultipleWindows(true);
    webview.getSettings().setPluginsEnabled(true);
    
     webview.setWebChromeClient(new WebChromeClient() {
        public void onProgressChanged(WebView view, int progress)
        {
            activity.setTitle("Loading...");
            activity.setProgress(progress * 100);
    
            if(progress == 100)
                activity.setTitle(R.string.app_name);
        }
     });
    
    
    
     webview.setWebViewClient(new WebViewClient() {
    
    
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url)
        {
            view.loadUrl(url);
            return true;
    
        }
     });
    
     webview.setWebChromeClient(new WebChromeClient(){
       public boolean shouldOverrideUrlLoading(WebView view, String url) {
           if (url != null && url.startsWith("http://")) {
               view.getContext().startActivity(
                   new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
               return true;
           } else {
               return false;
           }
       }
    
    
      });
    
    webview.loadUrl("http://www.sherdle.com/apphosting/dd");
    
    
     }
    
     @Override
     public void onBackPressed (){
        if(webview.canGoBack()) webview.goBack();
        else super.onBackPressed();
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add this code: <link rel=stylesheet type=text/css href=css/global.css /> <!--[if lt IE
i have this javascript code to which i want to add the jquery fade-in
I want to add an external css sheet and I use this JS code:
I want add new Feed item on entity persist and update. I write this
I created a Jar file from my java code : public void create() throws
I am using Formatter to output Java code to a file. I want to
I have here this code. I want it to first display an image file
I want add some resource files (non-code text-based files) to the jar file in
I want to rewrite http://website.com/?slug=product_info.php&products_id=32 to http://website.com/product_info/32 and I use this code, add_filter('rewrite_rules_array','wp_insertMyRewriteRules'); add_filter('query_vars','wp_insertMyRewriteQueryVars');
for example, I want to add this to jsfiddle.net jQuery Validation is this possible?

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.