SwipeRefreshLayout to refresh WebView

Suppose you have an app which contains a WebView webview1 inside a LinearV linear1. In onCreate it loads a website and onBackPressed it goes to previous page.

To implement SwipeRefreshLayout in this app to reload the WebView, follow the steps given below.

1. Swith on AppCompat and design.

2. Create a more block extra and put codes to declare a SwipeRefreshLayout srl.
Copy code
}
androidx.swiperefreshlayout.widget.SwipeRefreshLayout srl;
{


3. In onCreate event, before loading url in WebView;
* define a new SwipeRefreshLayout srl,
* remove all views from linear1,
* add SwipeRefreshLayout to linear1,
* add WebView to SwipeRefreshLayout,
* setOnRefreshListener for the SwipeRefreshLayout,
* In onRefresh event of OnRefreshListener, load WebView getUrl in WebView using blocks.

Copy code
srl = new androidx.swiperefreshlayout.widget.SwipeRefreshLayout(this);

linear1.removeAllViews();
linear1.addView(srl);
srl.addView(webview1);

srl.setOnRefreshListener( new androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener() {
@Override public void onRefresh() {

// PUT BLOCK TO REFRESH WEBVIEW HERE

}});

4. Add WebView onPageFinished event. Here, to stop the SwipeRefreshLayout, use setRefreshing(false).


Copy code
srl.setRefreshing(false);

5. Save and run the project.

Comments

  1. Need The To Hire A Hacker❓ Then contact PYTHONAX✅

    The really amazing deal about contacting PYTHONAX is that the Hack done by us can’t get traced to you, as every Hacking job we do is strongly protected by our Firewall. It’s like saying if anyone tries to trace the Hack, it will lead them to us and we block whatever actions they are doing.

    We have been Invisible to Authorities for almost a decade now and if you google PYTHONAX, not really about us comes out, you can only see comments made by us or about us.

    Another Amazing thing to you benefit from Hiring our Hackers is that you get a Legit and the best Hacking service, As we provide you with Professional Hackers who have their Hacking Areas of specialization.
    We perform every Hack there is, using special Hacking tools we get from the dark web.

    Some list of Hacking Services we provide are-:
    ▪️Phone Hacking & Cloning ✅
    ▪️Computer Hacking ✅
    ▪️Emails & Social Media Account Hacking✅
    ▪️Recovering Deleted Files✅
    ▪️Tracking & Finding People ✅
    ▪️Hunting Down Scammers✅
    ▪️Hack detecting ✅
    ▪️Stealing/Copying Files & Documents From Restricted Networks and Servers ✅
    ▪️Bitcoin Multiplication✅
    ▪️Binary Option Money Recovery ✅
    ▪️Forex Trading Money Recovery✅
    ▪️IQ Option Money Recovery✅
    And lots more......


    Whatever Hacking service you require, just give us an Email to the Emails Address provided below.
    pythonaxhacks@gmail.com
    pythonaxservices@gmail.com

    PYTHONAX.
    2020 © All Right Reserved.

    ReplyDelete
    Replies
    1. Are you in Need For Hacker Hiring? Then Contact Mills Dachin
      For years now, We've helped organizations secure data base, so many sites USES US AS SECURITY BACK UP TEAM BECAUSE OF OUR METHODS OF HANDLING CYBER MISHAPS.
      ��"CLEAR CRIMINAL RECORDS"
      ��"iPhone HACK"
      ��"BINARY RETRIEVAL" AND LOT MORE BEEN DONE IN SHORT TIMING! 100%✓guarrantee

      * iOS/windows/Android Phone Hacking
      * All kind of loans
      *University Grades
      *Iclouds breaching
      *Criminal Records
      *Hacking ATM Cards
      *Binary Recoveries
      *BTC Mining
      * Cyber Scam recovery
      etc...!!!

      All you need do just Email:- *pointekhack@gmail.com
      *hyperhackerone@gmail.com *cyberhackertap@gmail.com
      *phdatabasesolution@gmail.com

      Delete
    2. Internet Of Today is filled with Scam? With Mills Dachin Quality jobs Delivery Assured, We have help Individuals Organization to Secure and to Recover there lost files/Password/ funds etc. We Are Hacker for Hire. I am saying leave your problem & your Worries for us to solve for you 100%✓guarrantee

      * iOS/windows/iPhone/Android Phone Hacking
      * All kind of loans
      *University Grades
      *Iclouds breaching
      *Criminal Records
      *Hacking ATM Cards
      *Binary Recoveries
      *BTC Mining
      * Cyber Scam recovery
      etc...!!!

      All you need do just Email:- *pointekhack@gmail.com
      *hyperhackerone@gmail.com *cyberhackertap@gmail.com
      *phdatabasesolution@gmail.com

      Delete
    3. FRESH&VALID SPAMMED USA DATABASE/FULLZ/LEADS

      ****Contact****
      *ICQ :748957107
      *Gmail :fullzvendor111@gmail.com
      *Telegram :@James307
      *Skype : Jamesvince$
      <><><><><><><>
      USA SSN FULLZ WITH ALL PERSONAL DATA+DL NUMBER
      -FULLZ FOR PUA & SBA
      -FULLZ FOR TAX REFUND
      $2 for each fullz/lead with DL num
      $1 for each SSN+DOB
      $5 for each with Premium info
      ID's Photos For any state (back & front)
      (Price can be negotiable if order in bulk)
      <><><><><><><><><><><>
      +High quality and connectivity
      +If you have any trust issue before any deal you may get few to test
      +Every leads are well checked and available 24 hours
      +Fully cooperate with clients
      +Any invalid info found will be replaced
      +Payment Method(BTC,USDT,ETH,LTC & PAYPAL)
      +Fullz available according to demand too i.e (format,specific state,specific zip code & specifc name etc..)
      <><><><><><><><><><>
      +US cc Fullz
      +(Dead Fullz)
      +(Email leads with Password)
      +(Dumps track 1 & 2 with pin and without pin)
      +Hacking & Carding Tutorials
      +Smtp Linux
      +Safe Sock
      +Server I.P's
      +HQ Emails with passwords
      <><><><><><><><>
      *Let's do a long term business with good profit
      *Contact for more details & deal

      ****Contact****
      *ICQ :748957107
      *Gmail :fullzvendor111@gmail.com
      *Telegram :@James307
      *Skype : Jamesvince$

      Delete
  2. Haven't you heard about cyber hacking company blank ATM card and how other people had benefited from it? I am Williams vivian by name, i want to share a blog and forums on how to get real blank ATM card,thank to cyber hacking company who helped me with an already hacked ATM CARD and i was so poor without funds that i got frustrated. One morning as i was browsing on the internet, i saw different comments of people testifying of how cyber hacking company helped him from being poor to a rich man through this already hacked ATM CARD. I was skeptical if this was true, i decided to contact him to know if he is real he proved to me beyond all doubts that its was really for real so i urgently receive my blank ATM card. Contact his email cyberhackingcompany@gmail.com and today am also testifying on how cyber hacking company helped me. I never believed in it until the card was sent to me, which am using today Contact the company now and become rich. Email: cyberhackingcompany@gmail.com  ....

    ReplyDelete
    Replies
    1. Internet Of Today is filled with Scam? With Mills Dachin Quality jobs Delivery Assured, We have help Individuals Organization to Secure and to Recover there lost files/Password/ funds etc. We Are Hacker for Hire. I am saying leave your problem & your Worries for us to solve for you 100%✓guarrantee

      * iOS/windows/iPhone/Android Phone Hacking
      * All kind of loans
      *University Grades
      *Iclouds breaching
      *Criminal Records
      *Hacking ATM Cards
      *Binary Recoveries
      *BTC Mining
      * Cyber Scam recovery
      etc...!!!

      All you need do just Email:- *pointekhack@gmail.com
      *hyperhackerone@gmail.com *cyberhackertap@gmail.com
      *phdatabasesolution@gmail.com

      Delete
  3. Sir. my AppCompat is not working. Please help me....

    ReplyDelete
  4. Hello all
    am looking few years that some guys comes into the market
    they called themselves hacker, carder or spammer they rip the
    peoples with different ways and it’s a badly impact to real hacker
    now situation is that peoples doesn’t believe that real hackers and carder scammer exists.
    Anyone want to make deal with me any type am available but first
    I‘ll show the proof that am real then make a deal like

    Available Services

    ..Wire Bank Transfer all over the world

    ..Western Union Transfer all over the world

    ..Credit Cards (USA, UK, AUS, CAN, NZ)

    ..School Grade upgrade / remove Records

    ..Spamming Tool

    ..keyloggers / rats

    ..Social Media recovery

    .. Teaching Hacking / spamming / carding (1/2 hours course)

    discount for re-seller

    Contact: 24/7

    fixitrogers@gmail.com

    ReplyDelete
    Replies
    1. Internet Of Today is filled with Scam? With Mills Dachin Quality jobs Delivery Assured, We have help Individuals Organization to Secure and to Recover there lost files/Password/ funds etc. We Are Hacker for Hire. I am saying leave your problem & your Worries for us to solve for you 100%✓guarrantee

      * iOS/windows/iPhone/Android Phone Hacking
      * All kind of loans
      *University Grades
      *Iclouds breaching
      *Criminal Records
      *Hacking ATM Cards
      *Binary Recoveries
      *BTC Mining
      * Cyber Scam recovery
      etc...!!!

      All you need do just Email:- *pointekhack@gmail.com
      *hyperhackerone@gmail.com *cyberhackertap@gmail.com
      *phdatabasesolution@gmail.com

      Delete
  5. Do you need to hire a licenced hacker who can stand in court? Track Internet Browsing History and Read phone Access Address Book, totally worth your money, please no time wasters, he won’t under any circumstances work for free, you can reach him by email or text, The Ghost hacker Ethical hacking team is issuing out a premium for every hacking services, with sophisticated TECH in hacking world, reliable, effective , efficient and prolific in our deals.

    Make your contact for our professional hacking services today and be sure of a clean and thorough job. Changing of school grades, retrieving of school transcript , hacking of social media accounts eg facebooks, twitter, instagram ,hangout ,whatSapp , Wechat, including dating sites, deleting and retrieving of documents permanently, deleting
    criminal records, flipping of cash, BANK jobs with specific deals, cloning cell phone of your spouse or kids, company hacking and prototypes of any documents from the source .The best part is that it can never be TRACED back to you.

    Contact: Expressethicalhackingservices@gmail.com
    Text/Call: ‭+1 (424) 274-2967‬
    Business whatsapp:‪+19252910054‬

    ReplyDelete
    Replies
    1. Are you in deep shock and pains and you feel it is all over for you? the ANSWER IS ((NO)) IT IS NOT. NEVER GIVE UP!! with us M&D group of hackers Team we bring back hopes & joy with positive Result & Retrieve back all that you have lost with %110 Assured. If you fall in this categories please contact us by this Email:- pointekhack@gmail.com hyperhackerone@gmail.com ((University Grades. Loans. Wiping Criminal Records Credit Cards Binary Recovery. iClouds Breaching YouTube and Phones Hacking)) For years we have stand as backup for Individuals Organization to Secure and to Recover there lost Files/Password/ Bitcoin and funds etc.
      REMEMBER YOUR HAPPINESS IS OUR PRIDE

      Delete
  6. This will be simple steps to get a true hacker. I have been scammed too many times when i actually wanted to fix my credit profile due to negative information. This stopped me from buying a car, acquiring a mortgage or even a house. This particular thing gave me lots of concern because i needed to get a house for me and my family. while i was online, I ran into this hacker who’s good work is all over social media and net. Many people here endorsed CLEVER HACKER as a result of his good work, kindness and professionalism. When i contacted him he told me to give him some couple of days to get through it and I gave the hacker guy a try. To my greatest surprise he deleted all the negative information on my credit profile just as he said within 5 days. Am now proud of my credit score been increased to 790. All thanks to him. You can reach him through the contact; CLEVERHACKER.HACK@GMAIL.COM or (803)8145462

    ReplyDelete
  7. In the United States, criminal records can be expunged, though laws vary by state and are also subject to the federal system. Many types of offenses may be expunged, ranging from parking fines to felonies. In general, once sealed or expunged, all records of an arrest and/or subsequent court case are removed from the public record (however, some independent criminal data providers may still have an expunged record in their database, which they by law have to delete, but only upon notice), and the individual may legally deny or fail to acknowledge ever having been arrested for or charged with any crime which has been expunged...contact Theredhackergroup@gmail.com Or text/whatsapp +1 571 318 9498 to clear your felony charges or have them sealed from background checks....... GOD bless America.

    ReplyDelete
  8. I am Joe Engressia, Certified Ethical Hacker (CEH) — Delivered By Leading Experts‎.
    I major in…
    Games Hacking
    Credit score increase
    100% Change Of Grades
    Facebook, Instagram, Twitter, WhatsApp, Line, Skype Hack
    Delete unwanted online Pictures and Videos on any website
    Remove Criminal Records
    Tracing peoples background
    Apps hacking
    Loading all CreditCard, Bank Accounts, PayPal, Bitcoin, WU, Money Gram with untraceable credit on it. etc.
    Contact: digitaldawgpoundhackergroup@gmail.com
    Text whatsapp : +1(732) 639–1527.
    digitaldawgpoundhackergroup.blogspot.com
    Regards..

    ReplyDelete
  9. I am Joe Engressia, Certified Ethical Hacker (CEH) — Delivered By Leading Experts‎.
    I major in…
    Games Hacking
    Credit score increase
    100% Change Of Grades
    Facebook, Instagram, Twitter, WhatsApp, Line, Skype Hack
    Delete unwanted online Pictures and Videos on any website
    Remove Criminal Records
    Tracing peoples background
    Apps hacking
    Loading all CreditCard, Bank Accounts, PayPal, Bitcoin, WU, Money Gram with untraceable credit on it. etc.
    Contact: digitaldawgpoundhackergroup@gmail.com
    Text whatsapp : +1(732) 639–1527.
    digitaldawgpoundhackergroup.blogspot.com
    Regards..

    ReplyDelete
  10. My name is Dr Williams Curry, Medical Field, Sharing my experience, for any one who needs a trusted Hacker, who helped me change my Medical School Grade, His good on credit score, “Joe Engressia”.
    Reach him on Whatsapp: +1(732) 639–1527.
    Email: digitaldawgpoundhackergroup@gmail.com
    digitaldawgpoundhackergroup.blogspot.com.
    Regards…

    ReplyDelete
  11. My name is James and I want to tell you about a group of hackers who helped me recover my btc from an Internet fraud, whatever the task if its hack just contact watchprecinct@gmail.com. they are amazing group of hackers who work at amazing speed and unbeatable prices. Just contact watchprecinct@gmail.com

    ReplyDelete
  12. Are you desperately in need of a hacker in any area of your life??? then you can contact; ( www.hackintechnology.com services like; -hack into your cheating partner's phone(whatsapp,bbm.gmail,icloud,facebook, twitter,snap chat and others) -Sales of Blank ATM cards. -hack into email accounts and trace email location -all social media accounts, -school database to clear or change grades, -Retrieval of lost file/documents -DUIs -company records and systems, -Bank accounts,Paypal accounts -Credit cards hacker -Credit score hack -Monitor any phone and email address -Websites hacking, pentesting. -IP addresses and people tracking. -Hacking courses and classes CONTACT THEM= hackintechnologyatgmaildotcom or whatsapp +12132951376 their services are the best on the market and 100% security and discreet work is guarante

    ReplyDelete
  13. Fabulous blog with lots of information. I am glad to visit this, waiting for more updates.
    Ethical Hacking course in Chennai

    ReplyDelete
  14. I suspected my spouse of cheating on me but I never had any proof. This went on for months, I didn’t know what to do.
    i was so paranoid and decided to find a solution, i saw a recommendation about a hacker and decided to contact him.
    I explained the situation about my boyfriend to him and he said he was going to help me.
    I gave him all the information he required and afterwards i received all my spouse phones Text messages and calls,
    I was hurt when i saw a picture of my spouse and his lover.
    I feel so bad about infidelity. but i am glad (thehackerspro. com) was able to help me get all this information without any traces…
    for faster reply you can message their darkhat hacker vladimir kolarov directly on telegram @h4ckerspro or call/text 1 646 948 8125

    ReplyDelete
  15. If You Are Trying To Catch Your Cheating Spouse In The Act, I Strongly Recommend You Contact This Awesome Hacker That Helped Me Monitor My Husband’s Phone When I Was Gathering Evidence During The Divorce. I Got Virtually Every Information She Has Been Hiding Over The Months Easily On My Own Phone: The Spy App Diverted All Her Whatsapp, Facebook, Text Messages, Sent And Received Through The Phone: I Also Got Her Phone Calls And Deleted Messages. She Could Not Believe Her Eyes When She Saw The Evidence Because She Had No Idea She Was Hacked, I Didn’t Need To Touch Her Phone At all, I Certainly Recommend Contact: “Whitehatspytech@cyberservices.com”

    ReplyDelete
  16. i was lost with no hope for my wife was cheating and had always got away with it because i did not know how or

    always too scared to pin anything on her. with the help a friend who recommended me to who help hack her phone,

    email, chat, sms and expose her for a cheater she is. I just want to say a big thank you to

    HACKINTECHNOLOGY@CYBERSERVICES.COM . am sure someone out there is looking for how to solve his relationship problems, you can also contact him for all sorts of hacking job..he is fast and reliable. you could also text +1 213-295-1376(whatsapp) contact and thank me later

    ReplyDelete
  17. AFFORDABLE/COMFORTABLE LOAN OFFER WITHOUT COST/STRESS CONTACT US VIA Call/Text +1(646)820-1981 WhatsApp: +19292227023 Email drbenjaminfinance@gmail.com
    Loan Company Website: https://capitalmanage-inc.com/

    Do you find yourself in a bit of trouble with unpaid bills and don’t know which way to go or where to turn? What about finding a reputable Debt Consolidation firm that can assist you in reducing monthly installment so that you will have affordable repayment options as well as room to breathe when it comes to the end of the month and bills need to get paid? ®Capital Managements Inc™ is the solution to your financial misfortune. We offer all types of loan ranging from $5,000.00 to $533,000,000.00USD with a low interest rate of 2% and loan duration of 1 to 35 years to pay back the loan secure and unsecured. Our loans are well insured for maximum security is our priority, Our leading goal is to help you get the services you deserve, Our program is the quickest way to get what you need in a snap. Kindly reduce your payments to ease the strain on your monthly expenses by Contacting us on the following WhatsApp:+19292227023 Email drbenjaminfinance@gmail.com

    Loan Offer Alert For Everyone! Are you financially down and you need an urgent credit/financial assistance? Or are you in need of a loan to start-up/increase your business or buy your dream house. GET YOUR INSTANT LOAN APPROVAL 100% GUARANTEED TODAY NO MATTER YOUR CREDIT SCORE. drbenjaminfinance@gmail.com
    Capital Managements Inc Website: https://capitalmanage-inc.com/

    ReplyDelete
  18. and systems, -Bank accounts,Paypal accounts -Credit cards hacker -Credit score hack -Monitor any phone and email address -Websites hacking, pentesting. -IP addresses and people tracking. -Hacking courses and classes CONTACT THEM= hackintechnology@cyberservices.com or whatsapp +12132951376 their services are the best on the market and 100% security and discreet work is guaranteed

    ReplyDelete
  19. FRESH&VALID SPAMMED USA DATABASE/FULLZ/LEADS

    ****Contact****
    *ICQ :748957107
    *Gmail :fullzvendor111@gmail.com
    *Telegram :@James307
    *Skype : Jamesvince$
    <><><><><><><>
    USA SSN FULLZ WITH ALL PERSONAL DATA+DL NUMBER
    -FULLZ FOR PUA & SBA
    -FULLZ FOR TAX REFUND
    $2 for each fullz/lead with DL num
    $1 for each SSN+DOB
    $5 for each with Premium info
    ID's Photos For any state (back & front)
    (Price can be negotiable if order in bulk)
    <><><><><><><><><><><>
    +High quality and connectivity
    +If you have any trust issue before any deal you may get few to test
    +Every leads are well checked and available 24 hours
    +Fully cooperate with clients
    +Any invalid info found will be replaced
    +Payment Method(BTC,USDT,ETH,LTC & PAYPAL)
    +Fullz available according to demand too i.e (format,specific state,specific zip code & specifc name etc..)
    <><><><><><><><><><>
    +US cc Fullz
    +(Dead Fullz)
    +(Email leads with Password)
    +(Dumps track 1 & 2 with pin and without pin)
    +Hacking & Carding Tutorials
    +Smtp Linux
    +Safe Sock
    +Server I.P's
    +HQ Emails with passwords
    <><><><><><><><>
    *Let's do a long term business with good profit
    *Contact for more details & deal

    ****Contact****
    *ICQ :748957107
    *Gmail :fullzvendor111@gmail.com
    *Telegram :@James307
    *Skype : Jamesvince$

    ReplyDelete
  20. one upon a time when i had a ring on and promised that death could only do us part if not nothing more. The vow lasted shorter than i expected but as I always say, "marriage is like a party, when it ends, you leave".
    It too me no time to start suspecting my ex-husband cause he spent more time on his phone and on few occasions i have seen him smiling to his phone while texting. I was curious and needed to have answers. I confided in a friend and she suggested that i get some one who could help me gain access to his cell phone without his knowledge. The search for a professional ensued and i met couple of fake guys who got away with my money but since i needed answers i didn't give up the search while i still tried to find ways i could get his phone and access it, i got lucky one time but he had changed his password. I eventually met some dude 'alienm4n" whom i added on skype and he helped me,check.
    I was eventually able to get all the necessary information i needed to confront the unfaithful man and bring the whole marriage thing to a halt. You can contact them via (alienmanhackers.xyz) or alienmanh4cck @protonmail.com
    My candid advice is know whoever you want to end up with and where you are not respected or loved, leave!!

    ReplyDelete
  21. HELLO
    Loan Offer Alert For Everyone! Are you financially down and you need an urgent credit/financial assistance? Or are you in need of a loan to start-up/increase your business or buy your dream house. GET YOUR INSTANT LOAN APPROVAL 100% GUARANTEED TODAY NO MATTER YOUR CREDIT SCORE. WhatsApp:+19292227023 Email: drbenjaminfinance@gmail.com
    Capital Managements Inc Website: https://capitalmanage-inc.com/

    ReplyDelete
  22. Cyberspaceshield is a company with group of certified hacker, who are always ready to assist you with all your cyber problems.

    We’ve been in existence for ages now, we are reliable and helpful in terms of cyber bullying.

    We can help you get all your cyber threats and bullies solved in less than what you can ever imagine.

    These are somethings we specializes on:

    ➡️ Phone Hacks

    ➡️ Credit scores

    ➡️ Social media Hacks (Facebook, Instagram, tik tok).

    ➡️ Binary options

    ➡️ Binary Recovery

    ➡️ Clear criminal records etc.


    The internet is full of scammers, that’s why we’re here to help you fight them out.

    If you have been a victim of scam, don’t hesitate to write us on

    EMAIL: Cyberspaceshield@gmail.com

    Thank you!!!

    ReplyDelete

Post a Comment

Popular posts from this blog

A Flash Light App in Sketchware

Firebase auth in Sketchware for Login Activity

Simple car racing android game in Sketchware

In Sketchware: How to create a calculator for any simple formula?

Create a PDF reader android App in Sketchware