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
  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
  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

Post a Comment

Popular posts from this blog

Create Music Player app in Sketchware

A Flash Light App in Sketchware

Admob rewarded video Ads in Sketchware

Simple car racing android game in Sketchware

Firebase auth in Sketchware for Login Activity