How To Add Progress Bar On WebView

By Admin User
October 19, 2017 Comments

How To Add Progress Bar On WebViewHow To Add Progress Bar On WebView show that you can show your sites loading progress in your application. Watch the video properly and follow these steps. All the codes can be copy pasted from here.Watch Video :

🎥 Embedded content (YouTube Video)

XML Codes :

<ProgressBar
android:layout_width="wrap_content"
android:layout_height="match_parent"
style="?android:attr/progressBarStyle"
android:layout_centerHorizontal="true"
android:id="@+id/prg"/>Java Codes :public ProgressBarprogressBar;progressBar = (ProgressBar)findViewById(R.id.prg);{
@Override public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
progressBar.setVisibility(View.VISIBLE);
setTitle("Loading...");
}
@Override public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
progressBar.setVisibility(View.GONE);
setTitle(view.getTitle());
}

}On our next post we would go through changing the floating button and make it a share option.

Comments (0)

Leave a Comment

No comments yet. Be the first to comment!