WebView – Android Studio Tutorial



In this video we will create simple WebView to show a website. We will pass a new WebViewClient, load a URL and enable JavaScript by changing the WebSettings. We are also going to provide proper back navigation by overriding onBackPressed().

Example code for this video:

____________________
Subscribe to my channel:

Want more Android tutorials? Check my playlist section:

Follow me on social media:

Facebook:

Instagram:

Twitter:

Blog:

48 Replies to “WebView – Android Studio Tutorial”

  1. Kristóf Szobácsi

    Hello sir!! Thanks to you i was able to do my project and create my own Application for the Hotel i work for, so i am very greatful for you!! i created 3 fragment one of them is a webview which is linked to a wordpress site i created aswell and i would like to ask how i could set the back button to do what you just achivied but with the webview being on a different fragment not on the mainactivity window 🙂

  2. Thrift Pup

    Please help!
    I have been doing research on an issue i have, I am looking to combine 2 android studio projects and make 1 app with them. is there any way you could do a video on this?
    Your videos are very helpful and very descriptive!

  3. Jeffin J

    Hi, I have a webpage with tel: tag loaded into a webview, which users are able to make calls on clicking the number with tel: tag. But after a few days of usage that link won't work unless I clear the app data, what must be going on here? anyone? any thoughts?

  4. Hallo Nabil

    what is the different use WebSetting.setJavaScriptEnabled and not? I think there isn't different between use and no can you explain it? I'm newbie developer

  5. Sid

    how to allow this webview to upload anything from any website because now nothing happens whenever tap on upload a file.

  6. Dee Jott

    I am trying to load a Webview from my Wix.com site where an Instagram feed is. The feed itself is not shown when i load the app and the navigation bar within the webview can´t be used.

    Do i need any other permissions to use Instagram content?

  7. Abu Ahmed Suman

    I have made my webview app to see your video but when I transfer the apk to my mobile its not fit my mobile screen My emulator is nexus pro 4 and my mobile phone is Oppo f9 I want to know how its fit all screen size mobile. Thanks in Advance……

  8. Manuel OS

    hi there, im using a fragment to display my webview, the problem here is I dont understand how can I implement the onBackPressed scenario you did here?
    I know that is an activity method not a fragment method

  9. Emre Efe

    PLEASE HELP ME SIR,
    Hi sir, I'm doing a webview application. I have a problem: "Adsense ads appear when using Chrome custom tabs, but adsense ads don't appear when using regular webview."
    In normal webview, how are ads allowed?
    Example image: https://goo.gl/HSCxyz

Leave a Reply

Your email address will not be published. Required fields are marked *