How To Add Progress Bar On WebView
How 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.
Related Posts
Razorpay Integration in Android
Updated Dec 26, 2025
Parsing JSON Data in Android
Updated Dec 26, 2025
How to Install Android Studio on Windows
Updated Dec 26, 2025
Comments (3)
Leave a Comment
5 years ago
Hi, I have a simple webview and I added your code but the things is not happening.Can you help me.I am already joined in the said group. Thanks Nitu Kumar
5 years ago
Sure contact me at https://whatsapp.vishnusivadas.com
5 years ago
Hi , I have Made Mobile web view on a template , Could you please teach me how to add progress bar in it and even I have a website that is related to video , Iam not able to see thumbnail on my app, It is just Showing the logo of my app instead of thumbnails ,Iam totally unaware of the coding , Could you please Help ?
5 years ago
Sure. contact us on https://whatsapp.codeseasy.live
7 years ago
I add these codes in android studio, it was working fine but after few hours the circle rotating continuously, it is not stop even after page load, could you help me how to fix it.
7 years ago
It might be because of the visibility, set the visibility in XML to none then set it to visible in the java section.