Monday, May 25, 2015

Create android webview progressbar

In my activity add this line of code

myWebView.setWebViewClient(new WebViewClient() {
   public void onPageStarted(WebView view, String url, Bitmap favicon) {

              super.onPageStarted(view, url, favicon);
              findViewById(R.id.progress1).setVisibility(View.VISIBLE);
             }

            @Override
            public void onPageFinished(WebView view, String url) {
                findViewById(R.id.progress1).setVisibility(View.GONE);
            }
});

And inside xml add this line of code

<ProgressBar
    android:id="@+id/progress1"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />














Online adult games!!!










11 comments:

  1. hey thanks for your post..it's working fine...can you tell me how to replace progress bar with logo image??

    ReplyDelete
    Replies
    1. hm I'll try to find a solution

      Delete
    2. you cant for that you have to build a splash screen and then add the progressbar and logo to it

      Delete
  2. hi.. i want to update my horizontal progress bar in WebView Client but it is not working can you help me

    ReplyDelete
  3. how can i use this code in a fragment

    ReplyDelete
  4. What a great web blog . I like this blog because of its design and interface. Private Tutor in Wellington It is user friendly and it is nice to visit the blog.

    ReplyDelete

Namecheap.com