Android RecyclerView Example

Android RecyclerView example using view hodelr in adapter

(For using multiple layout in RecyclerView check this tutorial )

Add ‘com.android.support:recyclerview‘ in Gradle dependencies and sync it

my app/build.gradle file

MainActivity

Model

Adapter

Interface:

Layouts

Recycler View row

Out Put

recyclerview

 

If you want to add data to RecyclerView  add data into the Array List (eg:- usersList.add(new UserModel(“new name”, “345”)); and you can call the adapter function notifyItemInserted() or notifyDatasetChanged().

While editing edit the value in array list and call notifyItemChanged(position), while deleting delete the position from array list and call notifyItemRemoved(position)

 

  Like
Author: bm on August 30, 2016
Category: Android
Tags: , ,

Your comment:

Your Name

Comment:




Last articles