I’m quite new to developing Android apps. Basically I’m making a webview template to display different URLs where the websites a mobile optimized.
The app has two pages:
1 splash page.
1 webview page.
I have worked through several tutorials and this part is actually working, so the problem is…
I want to show a progress bar when the webview is loading the website which then disappears when the websites have been loaded.
I have made a lot of tries to get this to work, but without success.
The XML file:
Basically have the webview with the ID: and a progress bar with ID:progressbar ( Not sure if this should be in there )
The JAVA File:
Link to preeview of java file
You forgot to add
ProgressBarsupport.Add the below statement before
setContentView(R.layout.layout_file);Then after a call to
setContentView(R.layout.layout_file);add this line to make progressbar visibleNow inside
onProgressChanged(WebView view, int progress)you have to add following lines :You can refer full tutorial here : ProgressBar in WebView. I have referred the code from that website only.
Edit
Another example from official Android docs WebView