Recycler View Click Listener

Published by farizdotid on


Notice: A non well formed numeric value encountered in /home/farizdot/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/farizdot/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /home/farizdot/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/farizdot/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Ada yang belum tau Recycler View ? Kalau belum tau agan bisa melihat dokumentasinya di website Developer Android. RecyclerView ini upgradenya dari ListView secara garis besarnya. Ada berbagai macam cara untuk meng-click suatu data didalem Recycler View. Yang akan dishare disini adalah method / fungsi Recycler View Click Listener yang biasa ane gunakan.

recycler-view-click-listener

Pertama, Buat Class dengan nama RecyclerItemClickListener.

Kedua, Extends dengan RecyclerView.OnItemTouchListener.

Kode lengkapnya berikut ini :

Ketiga, Cara penggunaanya seperti ini :

 

Selesai dan Semoga bermanfaat. Jika ada yang ditanyakan boleh lewat komentar di post ini ya gan.

Salam #orangbiyasa #daakumahapaatuh

referensi : http://sapandiwakar.in/recycler-view-item-click-handler/

0 Comments

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.