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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:36:12+00:00 2026-06-09T16:36:12+00:00

I have a simple application with one button, when the button is pressed a

  • 0

I have a simple application with one button, when the button is pressed a dialog opens with a progress bar.
When the url is loaded it shows an image in a webview.
The funny thing is, if you press it a 100 times, it doesn’t open sometimes.
Tested it on a real device on android 2.3.3 and emulator 4.0.3.

Does someone know why?

HelloWebViewActivity.java

public class HelloWebViewActivity extends Activity {

ProgressBar progressBar;
WebView a;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

  this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
  setContentView(R.layout.main );

  TextView buttona = (TextView) findViewById(R.id.button);
  buttona.setOnClickListener(new OnClickListener() {
     public void onClick(View v) {
        final Dialog dialog = new Dialog(HelloWebViewActivity.this);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.requestWindowFeature(Window.FEATURE_PROGRESS);
        dialog.setContentView(R.layout.webview);

        a = (WebView) dialog.findViewById(R.id.webview); 
        a.getSettings().setSupportZoom(true);      
        a.getSettings().setBuiltInZoomControls(true);

        progressBar = (ProgressBar) dialog.findViewById(R.id.progressbar);
        progressBar.setProgress(0);
        progressBar.setVisibility(View.VISIBLE);
        a.setWebChromeClient(new WebChromeClient(){
        public void onProgressChanged(WebView view, int progress) {
            progressBar.setProgress(progress);
            if(progress == 100) {
                progressBar.setVisibility(View.GONE);
                }
            }
    });
      a.loadUrl("http://www.deshow.net/d/file/car/2010-10/seat-electric-car-879-2.jpg");
      dialog.setCancelable(true);
      dialog.show();
      }
  }); 

}
}

webview.xml

 <?xml version="1.0" encoding="utf-8"?>

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent" >


 <ProgressBar 
     android:id="@+id/progressbar"
     style="?android:attr/progressBarStyleHorizontal"
     android:layout_width="fill_parent"
     android:layout_height="20dp"
     android:max="100"
     android:visibility="gone" />

 <WebView
     android:id="@+id/webview"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"/>

 </LinearLayout>
  • 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-09T16:36:13+00:00Added an answer on June 9, 2026 at 4:36 pm

    I did not solve it but made a work around.
    I made the webview in a new activity with a onResume thing that retrieves the url of the image.
    This way the image is loaded in a activity instead of a dialog, what looks less fancy but it always loads with a progress wheel.

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

Sidebar

Related Questions

I have a simple application that contains one button to be clicked in order
I have a simple Crud application where there is one filed called Category. During
I have a simple jokes application. When you press the button you get new
I have in mind one simple application, but I would like to add some
I have a simple Android application that has a TabBar and one of the
i have an application that shows a simple square polygon represented on a GLSurfaceView.
I have a simple application. When you click a button, the tasbar icon changes.
I have a simple application that has richTextBox and button. User enters numbers(integers) into
I have prepared one sample application.When application install in devices download the file from
I have simple WinForms application where modifying Windows Registry. The problem is that in

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.