Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - SwipeRefreshLayout import not found

I'm trying to implement the new RefreshLayout widget but it seems my eclipse doesn't recognize the import I need to set. I used this guide to get started: Swipe to refresh GUIDE

And here is where it all started: Android dev - Swipe to refresh

My first guess was that I need to update my project in some way to get the latest android API's? I've never done that before and I don't even know that possible.

If anyone could lead me into the right direction to solve this problem that would be great.

The import line:

import android.support.v4.widget.SwipeRefreshLayout;

Manifest:

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="19" />

After updating the libraries to latest versions the import is still not recognized.

like image 535
Niels Avatar asked Apr 03 '14 17:04

Niels


2 Answers

just add this into yourbuld gradle module dependencies:

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
like image 131
Sohrab Gharavi Avatar answered Sep 20 '22 20:09

Sohrab Gharavi


If you are using Material Library version 1.2.0 (like com.google.android.material:material:1.2.0-alpha03) , than you must import swipe refresh layout library too.

   implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
like image 31
murgupluoglu Avatar answered Sep 22 '22 20:09

murgupluoglu