Friday, September 5, 2014

Android: RecyclerView cannot be resolved to a type

RecyclerView cannot be resolved to a type? How to resolve it?

We need recyclerview-v7 Support Library to solve the issue. but how to get? letc check...

Check whether Recyclerview is existing in the SDK or not because it is a part of the support library.

If you're not find the folder “recyclerview-v7” in the following sdk directory "..\sdk\extras\android\m2repository\com\android\support" then follow the steps otherwise follow from step 3.

Steps to achieve:
  1. Select the latest Android SDK Tools, Platform-tools, and Build-tools.
  2. Select latest Android Support Library & Android Support Repository.
  3. After updating Android Support Repository from SDK Manager go to..\sdk\extras\android\m2repository\com\android\support\recyclerview-v7\21.0.0-rc1
  4. Unzip recyclerview-v7-21.0.0-rc1.aar
  5. After unzipping recyclerview-v7-21.0.0-rc1.aar you will get classes.jar
  6. rename classes.jar to recyclerView.jar for feature reference and add to your Android app under /lib folder
Overview:
RecyclerView updates and replaces ListView. It's claimed to be easier to use and feature performance improvements in dynamic views.

RecyclerView is easy to use, because it provides:
  • A layout manager for positioning items
  • Default animations for common item operations

The most important classes of the RecyclerView API.

Class
Usage
Adapter
The Adapter is also responsible for making a View for each item in the data set.
LayoutManager
A layout manager positions item views inside a RecyclerView and determines when to reuse item views that are no longer visible to the user.
ItemAnimator
Animations for adding and removing items are enabled by default in RecyclerView



Thanks for reading :)
Any suggestions can be added in comments. feedback are welcome.

No comments :

Post a Comment