Tag Archives: webview with loader

loader

Hello fellas , today’s tutorial is very short and easy to learn , In this tutorial I am going to show you how to show loader or we can say Progress Dialog on webview while loading web content like website or some HTML pages.

Note – Here we need to give attention , we have to give the permission of Internet while loading website or web content in our Androidmanifest.Xml file.

Download Code

SO, lets start quickly and just create new project with your desire name and open your activity_main.xml 

In this code we just add add webView and you can take any number of views according to your needs. if you want to add admob ads to your mobile website then make another Linear Layout at bottom and you can load your website in upper layout.

Now our main Java portion , just open MainActivity.java file and paste the below code in which i have created one method to load webView , and enable all the javascript content.You can customize it according to your need.I also take progress Dialog before hitting website and close it after completion of loading so that it is very easy for the user to use the application that loads heavy data.

You have another option to customize your application with “Pull to refresh in WebView” just go to my tutorial series if you haven’t read  Here .

MainActivity.java

 

AndroidManifest.xml is the main part please update it –

 

 

Now Run your project and you will see the magic is in your emulator :p

OutPut –

loader_website

 

 

loader_output

 

after_loading

Please comment if you found any issues and errors 🙂