Android Browser – WebView – Complete Tutorial Series Part 3 – Adding Swipe Refresh, URL Share, etc

Hi guys what’s going on welcome back to
this brand new Android studio tutorial so today in this video I will show you
that how to add a swipe to refresh for this book view and the next and after
that we’ll be going to add maybe like before that will be going to remove this
progress bar and this image view once that maybe like not removing just I mean
just like hiding this once that webpage is completely loaded and then we’ll be
adding the swipe to refresh for this book view and finally we’ll be adding a
menu maybe like mid or something like that and at the menu it will be a button
to share the web page or the web page URL to somewhere else using a text
message or something like that so first off let’s go to Android studio now we
have the layout which is this linear layer we use it to at the progress bar
and the image view so to access the layout I’m just going to give it IV for
that now using that idea I’m just going to paste here here also linear layout
okay now we need to add the linear layout okay now what we need to do is
that we already created the method which is the said Bob you client and now I’m
just going to open a curly braces at this point and inside that just pressing
the control all on the keyboard to bring up the selected matter and this small
pop-up window now what we need to do is that we have to simply find this thing
which is called one page one page finish here this is a method that we require so
you can just get that method just by searching on the keyboard on page
Phoenicia and once you do then just go and select this one click on the okay
now you have it now it will return the book view view and also it will return
the URL of the current web page or on the web page is completely it’s loading
now we need to hide the linear layout so what we need to do is that we how the
super ok super linear layout then we need to hide it so set visibility
then gone it is not we don’t have to set it into invisible instead of that we
need to set it as gone the difference between gone and invisible is that when
the layout is invisible then it is actually there but it cannot be shown as
as a layout and instead we can just you know that item behind the linear layout
cannot be accessed at that specific area of the linear layer because it is
actually there and when you just click on that specific area it is actually
clicking on the linear layout not the web view behind that so just I hope you
guys got the idea so one patreon page finish it then it
will how to just close that so at this point the thing is that when the page is
completely loaded then it will be just going to hide this but when we are just
opening a new window or going to another page then it won’t be showing as it is
already gone now so that one we need to do is just go back and on page starter I
did we have just call this method 2 so now at this point we need to set it as
you know okay visible now we are done now let’s go and try that in the real
Android device let’s wake up this boy we have to wait a couple second
ok guys so it’s trying to install that app and now it’s loading now we have and
we have everything is same from the last video let’s wait until the page get
fully loaded and now it’s slaughter and blam as you can see it is just hiding
the layout of that progress bar and the image view now we have a complete view
for this book view so let’s try to go into next page or make another move and
let’s see if the page if the layout is coming back and blam it’s working
perfect so we can just move to the next part which is the swipe to refresh so
let’s go and that before that I just want to say that
if you want to just bring some kind of animation for hiding and a and bringing
it back I mean the progress but then you can also do that using the animation
utensils or something like that now let’s go back now we need to change this
linear layout into swipe to swipe refresh layout this point we have to
give a ID for there so ID my swipe layout let’s go to and swipe adding it
here okay now what we need to do is that one swipe we have to simply call a
single thing that is you know I’m just going to call it over here it is a
better area now swipe layer and their own refresh listener then you on refresh
listener and inside that what we need to do is that we have to simply call this
line so this is just a basic and they use how to understand what I’m actually
saying this is a basic idea there will be how some sort of you know top
technique that you can do to reload the page but I’m just simply doing this
thing you know ah the thing is that it is impossible to
do like this because instead we have this call real or because let me just
call this method which is the lower URL it will be whenever the pages swipe or
from let’s suppose I’m in my youtube channel page and when I just swipe it
that it will be loading the Google home page but instead we need to load the
same page twice sorry not twice we have reload the page so
instead we have to call don’t reload now we all ready to go and you know the
thing is there at this point it will not be hiding let me show you I’m just going
to run the app again okay now it’s running installing the epic a launching
the activity no oops as you guys can see we got
something like this so probably what we need to do is that we have to just go
back to the layout so just going to activity
no we changed the the swipe layout we just going to use that the old one yeah
completely going back now we have to set it into linear layout itself now what
I’m going to do is that I’m just going to just bring the board of this item
inside the swipe refresh layer match pairen now adding it inside that so the
thing is that I guess the swipe refresh layout can only afford a single child at
this point what we need to do is that maybe like me how to call a we have to
add yeah we I just want to I just want to say that we have a different way that
can able to achieve the goal so taking it from here oh no I’m just going to
switch it back into swipe refresh layout within the same ID that can be done
after a while now I’m just going to create a linear layout here miss Perrin
and say that I’m just going to pace the one that we have this copied from yeah I
think the orientation has vertical giving the ID same what it was my swipe
layer okay now we are good to go and let’s go and try this out I’m sure that
it will be working this point yeah most probably it will be working I guess
there is no sort of any errors ok guys so now we have the Android app and it’s
everything is same from the last time now as we know we have this far to
refresh now the problem is that as I said we have the reloading which I mean
like the spinner loading spinner all the time it’s not going to disappear after a
while so what we need to do is that we have to simply call a single thing so it
come to this on page finished method of the Bob you client and inside that we
have this just call one thing there is super then swipe layout then set
refreshing then we have to set it into Falls and that’s it let’s go and try it
again and now it’s sweaty let’s try to go to my search result now I’m in the
second page just trying to reload now blam everything is fucking perfect
that’s the second part which is adding a strike refresh layout now finally what
we need to do is that we how to add a image sharing menu or something like
that so when the sherry selector we have to share the URL of the current page so
I’m just going to the middle adding a new menu item just copying this exact
same thing pasting it here or changing the name into this creating a drawable
for that share okay next finish now I want to just set it into just removing
the always from both of the cases which is always suggest now what I need to do
is that I want to be hell – menu share just go to the menu just creating
another case although I did odd menu share and at this point what we need to
do is that we how to create a share intent so before that we have to get the
URL of this through the one page finisher so we have the URL I’m just
going to for a easy way I can just I am just going to create a string so my
current URL and just living it into free now just go and we how to just call that
so my current URL equal to then URL now that’s it so this way it will get the
URL from the string which is which from this one page they finish it matter
now and that URL will be transferred to this string which is outside the Incred
that way we can just call that thing over here
so now what I’m going to do is that I’m just going to create it in dead then
indent and that indent is going to get the sharing thing so I just want to say
that I have made a separate video on the indent so shearing indent so if you want
to watch it then you can just click over here somewhere else there will be a I
round on the right top corner just click on that and there will be the video on
that so I’m just going to skip this plot for saving some time on this video ok
guys so now I have written every single thing required now this is the
description if you want to add it so in our case we have the description as you
know I’m just going to set the string as the description which is going to be
this thing so my current URL I’m just going to instead of this character type
I’m just going to call it as my current URL and the title can be and this can be
something like ok so let’s try this and I hope it will be working and I hope
there will be no any sort of problems at this point but let’s see what happened
when we are going to run the app oh yeah now it’s going to run and blam
everything is working perfect there is no problem at this point now I’m just
going to you know just go to the next page to be more precise with our URL now
I’m in the second page hopefully the link will be completely different from
the home page now I’m just going to click on this chez up and let’s see what
happened now sure you are out with France everything is working I hope
there is no problem at this point so I’m just going to select the message
messenger now just going to click on the new message let’s see if we get the
you know yeah I don’t know how you walk let’s try with some random number and
blemish you can see we got that URL inside the text field no that means it
is working perfect let’s go and try it out I’m so much excited about seeing
that let’s go back I’m just going into my youtube channel
let’s see what happened at this point now let’s wait and let it get done you
know okay come on now let’s go click on the share this number and blam it’s
working perfect there’s no any kind of problem so that’s for this video and I
hope this video was helpful for some of the users who are really coasting
foresaw some sort of where yeah yeah some sort of tutorials and I think that
you really like my new channel banner and if you do then leave a like for this
video and as you can see now I have 18,000 subscribers which is a really
good amount according to me and so I need to get in 200,000 subscribers which
is one of my goal of his channel so if you guys are really supporting like I’m
pretty sure that you will be having a lot of channels I mean like north
channel you will be having a lot of whatsapp group and Facebook groups so if
you are if you feel any mercy towards me then just share my channel and my videos
with your friends so that me and you guys can grow together and make this
into a grand success so as always I just want to say a big thanks to everyone who
were supporting me till this time so that’s it and as always thanks for
watching and hope to see you in my next video peace out

51 thoughts on “Android Browser – WebView – Complete Tutorial Series Part 3 – Adding Swipe Refresh, URL Share, etc

  1. I saw your YouTube channel's cover pic. Even dude you are also good in logo and arts designing.
    Can you please tell me that how do you create cool cover pics for your YouTube channel?

  2. I am creating a browser more than 6 month i am so confused
    Thank you you started a series for web browser
    I implemented almost all features
    Now remaining only advance download feature
    And photo download like chrome when we search images there is option to download how to implement this make a video on this also
    And 1 more question

  3. I've started a browser development, really great tutorial sir, I'm stuck at the URL portion of browser.
    How can I identify whether the user entered string is an existing URL or just a search query.
    I want to redirect to the domain if it is a valid URL and if not than a simple search engine search.
    Any help would be grateful.

  4. swiping refresh is not working properly.. when i want to swipe/see upside of the page from the middle of the same page it is going to refresh the page.

  5. how to over come the swipeRefresh when i scroll down the page and want to up again the SwipeRefresh call out and never goes and its did not download data from my own website please

  6. Sir your video is very good. But sir am find one problem in swipe refresh in webview page.
    When we visit any page and go down and try to to go up swipe is work not parfectly page up

  7. when there is a long web page…when i am scrolling up it is getting refreshed…plz solve this problem…
    and i am very thankful to your videos…

  8. Hi bro, i created webView as per your guidance, when i try to load youtube inside the webView, I am not able to get landscape mode. the landscape mode icon is disabled. do you have any idea how to fix that?

  9. Sir please let me know once thing, how do we can save password in webview while login to website, which would use second time login for auto fill form.

  10. downloadListner isn't working homie, when I click on a linked pdf hyperlink, it asks me to complete the action in another browser app (chrome)

  11. part 3 completed successfully, time for 4… bytheway, i want to change progress bar color whenever webview start a progress with a random color…. what to do to work like that?

  12. I have create webview android app with your tutorial videos for my audio website, audio files can't play in the app. But audio files playing on my bootstrap website, can you help it?

  13. thank you dude.
    this was a good tutorial,
    BUT the refresh isnt working correctly. you should make a tutorial to fix that.
    i went to the stack flow link but didnt understand what to do

    again, thank you.

Leave a Reply

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