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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:25:38+00:00 2026-06-01T09:25:38+00:00

I am developing android web application for a blog like website. For this I

  • 0

I am developing android web application for a blog like website.
For this I am showing HTML page contenting list of categories which when clicked shows articles related to that category.

I am fetching this articles from website’s RSS feeds which is in XML format and by using JavaScript I am parsing it to display on HTML page.

This process of parsing XML takes lot of time to load a page.During this period I am getting blank screen.I have implemented progress dialog which works fine when page is loading for the first time but when XML is getting parsed by JavaScript it does not appear.

Here is how I implemented Process dialog.
Activity.java:

@Override
public void onCreate(Bundle savedInstanceState)
{
     super.onCreate(savedInstanceState);
      this.getWindow().requestFeature(Window.FEATURE_PROGRESS);

        setContentView(R.layout.main);

        getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
                Window.PROGRESS_VISIBILITY_ON);

        webview = (WebView) findViewById(R.id.webview);
        webview.getSettings().setJavaScriptEnabled(true);
        webview.setBackgroundColor(0);

        final ProgressDialog progressDialog = new ProgressDialog(activity);
        progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        progressDialog.setMessage("Loading...please wait");
        progressDialog.setCancelable(true);
        webview.setWebViewClient(new WebViewClient()
        {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url)
            {
                view.loadUrl(url);
                return true;
            }

        });

        webview.loadUrl("file:///android_asset/HomePage.html");

        // WebChromeClient give progress etc info
        webview.setWebChromeClient(new WebChromeClient()
        {
            public void onProgressChanged(WebView view, int progress)
            {
                progressDialog.show();
                progressDialog.setProgress(0);
                activity.setProgress(progress * 1000);
                progressDialog.incrementProgressBy(progress);
                if (progress == 100 && progressDialog.isShowing())
                    progressDialog.dismiss();
            }
        });
}
  1. How can I show progress dialog while XML is being parsed by JavaScript?
  2. Also I want to show an error message if no internet connectivity available for same thing is their any way to do so?
  3. I have used call function as “tel:phone number” which was working but after I added de
    public boolean shouldOverrideUrlLoading it is not working? what’s i done wrong?
  • 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-01T09:25:40+00:00Added an answer on June 1, 2026 at 9:25 am

    for your questions You can use following code in your activity.java file

       package com.package name;
    
    import android.app.Activity;
    import android.app.AlertDialog;
    import android.app.ProgressDialog;
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.net.Uri;
    import android.os.Bundle;
    import android.view.Window;
    import android.webkit.WebChromeClient;
    import android.webkit.WebView;
    import android.webkit.WebViewClient;
    import android.widget.TextView;
    import android.widget.Toast;
    public class Myactivity extends Activity {
        TextView myLabel;
        WebView wv;
        final Activity activity=this;
        /** Called when the activity is first created. */
    
    
    
    
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
    
            setContentView(R.layout.main);
    
            getWindow().setFeatureInt(Window.FEATURE_PROGRESS,Window.PROGRESS_VISIBILITY_ON);
    
            wv=(WebView)findViewById(R.id.webview);
            wv.getSettings().setJavaScriptEnabled(true);
            wv.setBackgroundColor(0);
    
            final ProgressDialog progressDialog = new ProgressDialog(activity);
            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
            progressDialog.setMessage("Loading...please wait");
            progressDialog.setCancelable(true);
            wv.setWebViewClient(new WebViewClient()
            {
                @Override
                public boolean shouldOverrideUrlLoading(WebView view, String url)
                {
                     if (url.startsWith("tel:")) { 
                         Intent intent = new Intent(Intent.ACTION_DIAL,
                                 Uri.parse(url)); 
                         startActivity(intent); 
                         return true;
                 }else{
                    view.loadUrl(url);
                    return true;
                }
    
                }
            });
    
            wv.loadUrl("file:///android_asset/page.html");
    
            // WebChromeClient give progress etc info
            wv.setWebChromeClient(new WebChromeClient()
            {
                public void onProgressChanged(WebView view, int progress)
                {
                    progressDialog.show();
                    progressDialog.setProgress(0);
                    activity.setProgress(progress * 1000);
                    progressDialog.incrementProgressBy(progress);
                    if (progress == 100 && progressDialog.isShowing())
                    progressDialog.dismiss();
                }
            }); 
    
            if (AppStatus.getInstance(this).isOnline(this)) {
    
                Toast t = Toast.makeText(this,"Welcome !!!!",8000);
                t.show();
                } else {  
                    AlertDialog alertDialog = new AlertDialog.Builder(
                            CafeNashikActivity.this).create();
    
            // Setting Dialog Title
            alertDialog.setTitle("No Internet");
    
            // Setting Dialog Message
            alertDialog.setMessage("Internet Connection not available!");
    
            // Setting Icon to Dialog
            //alertDialog.setIcon(R.drawable.tick);
    
            // Setting OK Button
            alertDialog.setButton("Exit", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        MyActivity.this.finish();
    
                    }
            });
    
            // Showing Alert Message
            alertDialog.show();  
                }
    
    
        }
    
    
    }
    

    Hope this will help you.

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

Sidebar

Related Questions

I am developing an Android application which rely on .NET web service for dynamic
I am currently developing an Android application which has a web backend. I can
Am developing an android web application which have to access an database in the
I am developing a mobile web application (for iPhone & Android) with a local
I am developing android application in which i have to open option menu from
i am developing an application for android and would like for my users to
i am developing an android application to get a list of class from wevservice
I m developing mobile web application for Android OS. Here, my requirement is to
I'm developing a web based application built on codeigniter which will also have a
Are there any guide lines for developing an Android web application? I am developing

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.