Issue
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.
Solution
To use SwipeRefreshLayout make sure you have updated Android Support Library. To check if it is updated follow below steps:
--> Open Eclipse
--> Go to Window-> Android SDK Manager.
--> In SDK Manager scroll down to bottom. Look for Android Support Library. If rev. is 19.1 then you are good to use SwipeRefreshLayout. If it is less than 19.1, then update Androd Support Library.
--> Once it is updated you can use SwipeRefreshLayout for new project. But you still cannot use SwipeRefreshLayout for existing projects.
Below are the steps to use SwipeRefreshLayout in existing project.
--> After updating Android Support Library, create new project.
--> Look for android-support-v4.jar in this project.
--> Copy android-support-v4.jar from new project and replace android-support-v4.jar of existing project with new project's android-support-v4.jar.
--> Now you can use SwipeRefreshLayout in existing project as well.
Answered By - Rajesh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.