RecyclerView Button Android Studio Example Get Click Position

Welcome guys to RecyclerView Button Android Studio Example.

In this RecyclerView Button Android tutorial, you will learn to make recyclerview with button in it’s row item.

You will learn to “handle button click inside a row in recyclerview” in RecyclerView Button Android tutorial.

If you have not implement basic recyclerview with custom adapter yet, check recyclerview android example first.

Official guide for recyclerview : RecyclerView Official

Now checkout the output of RecyclerView Button Android example, then we will develop it.

How to get maximum benefit from RecyclerView Button Android tutorial

Click to know great benefits

Download Source Code for RecyclerView Button Android example

Try Our App

Download DemoNuts app to learn anytime, anywhere: Click to get Demonuts App

Or search “demonuts” in play store from android mobile device.

Creating RecyclerView Button Android Studio programmatically example step by step

If you are using adblocker, then you will not be able to show our site smoothly. For example, you find step 6 after step 1 or similar to this. So please disable adblocker to fully utilize all resources of DemoNuts

Step 1: Create a new project in Android Studio.

Step 2: Updating build.gradle(Module:app) file

Add below source code into dependencies{}

Step 3: Coding cardview.xml

Create a new file into drawable folder and name it cardview.xml

Add below source code into it.

Step 4: Making rv_item.xml

Create a new layout resource file named rv_item.xml

Copy following source code into it

Step 5: Making Model class

Create a new JAVA class named and paste below source code

Step 6: Adding integer.xml

Create a new file named integer.xml  in values directory and copy below

Step 7: Code for

Let’s create Custom Adapter for RecyclerView.

Make a new JAVA class named and paste below

Describing CustomAdapter

We will set tags for Plus and Minus button with below source code

Following is the onClick method for Plus button

Following is the onClick method for Minus button

Step 8: Making NextActivity

Create a new activity named “NextActivity

Add following source code into

Paste following code into activity_next.xml

Step 9: Finally Update activity_main.xml and

Updating activity_main.xml

Make following code into activity_main.xml


Copy following into

Get cool Google search result

Click to get cool Google results

Share this tutorial by using sharing options available at left menu bar.

Your sharing will help other in their path to android development.

Also you can use the comment section for any queries.

So all for RecyclerView Button Android tutorial.

Thank you ?

Hardik Parsania

I am mobile app developer. I am always passionate about solving complex and real world problems.I have developed many apps with great interest and superior logical skills.

You may also like...

8 Responses

  1. Carel says:

    Thank you for a great tutorial. I copies and pasted the code just as it is to test it out, and the app crashes when the next activity button is clicked.

  2. dany says:

    can you share your source code

  3. Ankesh kumar says:

    please share code of above video i will be thankful

  4. Ehtisham says:

    where is the sourse code

Leave a Reply

Your email address will not be published. Required fields are marked *