RecyclerView OnClickListener (Best practice way)

  Рет қаралды 291,445

CodingWithMitch

CodingWithMitch

5 жыл бұрын

This video is part of a course named "SQLIte for Beginners 2019". It's free and available on my website: codingwithmitch.com/courses/s...
In this video I show you the best practice way to attach an OnClickListener to a RecyclerView and determine what list item was clicked.
➤Learn to code like me:
↻ codingwithmitch.com/register/
➤Source Code:
↻ github.com/mitchtabian/SQLite...

Пікірлер: 374
@milkjpg
@milkjpg 5 жыл бұрын
i have a project due in 3 days and your channel is saving my life!! thank you so much for this!!! never clicked on subscribe this fast!!!
@klekaelly
@klekaelly 2 жыл бұрын
Hey Mitch, just wanted to say I was stuck on a problem for a long time and your video (especially the part where you took us back and walked through everything we did) was super helpful. I was able to resolve my problem after re-approaching it with a clear head. Thanks for the guidance!
@jarrodthoma1866
@jarrodthoma1866 3 жыл бұрын
Mitch, I definitely appreciate your content. Software/firmware development is nothing new to me, but I recently got into app development, and this series has helped tremendously! I was having difficulty with changing the TextView text color within my ViewHolders in the RecyclerView, but was eventually able to figure it out with your interface examples on the Note RecyclerView series. Thank you so much.
@Richie_
@Richie_ 4 жыл бұрын
Coding with Mitch & Coding in Flow are the 2 best tutors on KZfaq.
@josepenasanchez1491
@josepenasanchez1491 4 жыл бұрын
Explaining what you code was doing as you typed, and at the end to summarized really helped!! Awesome tutorial!!
@apartmentbluerose-trogir7869
@apartmentbluerose-trogir7869 4 жыл бұрын
God bless you Mitch! It works like a charm!
@kristians1550
@kristians1550 2 жыл бұрын
Had to come back to this video to say how much I appreciate what you do, I have used this in my recyclerView app a long time ago and now I was looking for a way to fix a similar issue in different java swing application where I used the same concept with an interface and it works as a charm. Man you really have no competition when it comes to this stuff. Wish you pleasant holidays mate, you deserve it
@huh_wtf
@huh_wtf 4 жыл бұрын
This was such a god sent....Thank you for uploading this. Such an elegant solution.
@samusaran5509
@samusaran5509 5 жыл бұрын
Man i have been racking my brain trying to figure out why my click listener wasn't passing variables to a new activity. Thanks so much my dude.
@moazelsawaf2000
@moazelsawaf2000 4 жыл бұрын
Thanks a lot ❤️ This method is called inter fragment communication and we use it when we want our fragment to communicate with the activity...
@joeypeters2916
@joeypeters2916 4 жыл бұрын
Mitch, I have a degree in mobile app development. I wish I would have seen this while in school. It helped a lot and will continue to help a bunch. Thank you for all you do.
@noodler911
@noodler911 3 жыл бұрын
5:36 the this keyword doesn't work for me. It provides ValueEventListener instead of OnNoteListener. Do you know how I can solve this problem?
@GamerChris123
@GamerChris123 4 жыл бұрын
Finally helped me get my code up and running, migrating everything from Java to Kotlin was pretty seamless but the Adapter definitely gave me a couple migraines. Thanks!
@ianrknowles
@ianrknowles 3 жыл бұрын
Tried to get a recyclerview click listener working for hours - this tutorial finally cracked it - Thank you!
@hugocc0318
@hugocc0318 Жыл бұрын
Omg I have learned more in this video than searching through a thousand forums, thank you very much
@ki11qwerty47
@ki11qwerty47 4 жыл бұрын
omg!!! thanks a lot! i killed 1day to find best practice way for this )))
@chloegeldhof4921
@chloegeldhof4921 5 жыл бұрын
Thank YOU!!!! I changed it a little to apply to a fragment but after hours of finding shite tutorials it's finally working! I'll put your name on my bachelors degree LOL
@wertin200
@wertin200 4 жыл бұрын
Did you find a way to Go from one fragment to Another fragment And then to show the id that was passed through
@ericsmith2405
@ericsmith2405 4 жыл бұрын
Just fantastic! Finally someone who can break down a myriad of core topics into a one simple brain folder!!
@codingwithmitch
@codingwithmitch 4 жыл бұрын
Haha "brain folder". I like that
@WftYT
@WftYT 2 жыл бұрын
Thank you so much. I've got a huge project rn and the only thing that was troubling me is communication between the recycler view and the Activity that uses it. Thank you so much! It fixed my issue
@dungenhero7159
@dungenhero7159 3 жыл бұрын
I went to StackOverflow, couldn't find the solution. Then I found this. Worked like a charm. Thanks a lot
@dignitymashoko5437
@dignitymashoko5437 5 жыл бұрын
Man you are the best, keep up you are saving the world.
@nikhilcsuvarna8829
@nikhilcsuvarna8829 2 жыл бұрын
Thank you for this..I was searching whole day for this..🙌
@matthewmirandaa
@matthewmirandaa 3 жыл бұрын
I know the video's a couple of years old but I just really need to say that this was a great video/explanation, thank you so much, helped out a lot, pura vida 🙌
@harisdurrani8422
@harisdurrani8422 3 жыл бұрын
Superb...i searched every where but all were directing to onBind Holder...and that was very confusing for me,,, but your method is very very easy...and it solved all my problem...love you for this helpful guide....
@sonuchristopherk2273
@sonuchristopherk2273 4 жыл бұрын
amazingly short and easy to understand.. Keep rocking!
@martinsalcedoapps
@martinsalcedoapps 4 жыл бұрын
Really simple, great explanation. Thanks Mitch.
@themax734
@themax734 4 жыл бұрын
Thanks Mitch! This was exactly what I needed.
@vladkondratiuk5886
@vladkondratiuk5886 5 жыл бұрын
That's great, dude! When I was finding on Russian chanels this info, I didn't do that, but when I saw your video, I understand that no metter what I need, I have to search everything on English chanels at ones!
@marcoantonioblancastokunag1864
@marcoantonioblancastokunag1864 2 жыл бұрын
I am very happy to find your content. Excellent explanation, I have signed up for the full course on your website. Thank you!
@Tronx431
@Tronx431 3 жыл бұрын
2021 ik but thx alot dude, you fixed my crahing issues. I have my holder class separated from my adapter class so every time I clicked one of my items it crashed but not anymore, ur the best.
@samha1513
@samha1513 5 жыл бұрын
Clear and to the point as always. Everytime I watch your video I learn something new. Thanks.
@codinginflow
@codinginflow 5 жыл бұрын
Wow you must be a programmer or something
@codingwithmitch
@codingwithmitch 5 жыл бұрын
😏
@goldwings1468
@goldwings1468 5 жыл бұрын
Coding in Flow approves 😃
@anhchung7340
@anhchung7340 4 жыл бұрын
funny :)
@ehtashamali821
@ehtashamali821 4 жыл бұрын
Ohh Glad to see you here. You both are Best. Please guide me on this issue. I try to resolve this issue from last two weeks but not getting solution yet. How can I change the View which is previously clicked in RecyclerView. I have a play button in every single row of RecyclerView. Whenever this button is clicked button visibility changed like shown in this image imgur.com/0fpk0Jv. When user click on first row button visibility changed which is working fine. But when user click on second row button of RecyclerView I want to change the button of first row to came back to its original position. Scenario shown in this image imgur.com/n4Q26Qm
@tarikbenaliamar4033
@tarikbenaliamar4033 4 жыл бұрын
Codingin Flow you too, you are a genius ;)
@red2fire2
@red2fire2 5 жыл бұрын
Cheers, This really helped
@sitibalqis8032
@sitibalqis8032 5 жыл бұрын
Thank you Mitch! I finally be able to go to another different activity for each item clicked! Implemented the switch case in the onNoteClick and it worked! :)))) p/s: I used the coding from your previous recyclerview and edited from there.
@sitibalqis8032
@sitibalqis8032 5 жыл бұрын
But only for the toast message, i don't know where to put the coding. But i guess it's okay as long as my goal is achieved 😂
@madhuthakur472
@madhuthakur472 5 жыл бұрын
Really appreciate the way you explain things .. made android easy for me ..
@josephridge3646
@josephridge3646 3 жыл бұрын
Hey Mitch thank your for this !!! I appreciate the relay.
@mikolajm9175
@mikolajm9175 3 жыл бұрын
This is gold among so much shitty stack answers i found. Much thanks for this explanation and BRILLIANT revision at the end.
@mengmengliu6261
@mengmengliu6261 3 жыл бұрын
simple and elegant, thank you so much!
@IbnBattuta2
@IbnBattuta2 5 жыл бұрын
Thanks. Great tutorial as usual.
@switchend7776
@switchend7776 5 жыл бұрын
quality teaching bro thank you! learned a lot
@karagezify
@karagezify 4 жыл бұрын
Thanks for making this! Really helped me out!
@ryujikomai8859
@ryujikomai8859 4 жыл бұрын
Super helpful and straightforward. Thanks so much :)
@BaldPL
@BaldPL 4 жыл бұрын
Thanks for help! Good quality example of create own listener and use it in RecyclerView.
@vahidhoseini1723
@vahidhoseini1723 3 жыл бұрын
great, good job mitch.
@user-dm1te2rj5u
@user-dm1te2rj5u 5 жыл бұрын
Thank you sooooooooo much for your super kind explanation!! I found it so easy to follow. I've actually tried several ways to apply OnClickListener to recycler items but I had failed to come here! I'll keep subscribing for additional help! >ㅁ
@patrickgichuki1789
@patrickgichuki1789 4 жыл бұрын
Life and time saver! Thank you very much!
@jhonesns
@jhonesns 2 жыл бұрын
Thanks, it worked for me, I'm really happy, thank you so much!
@Thatbigx
@Thatbigx 5 жыл бұрын
Thank you very much, helped a lot.
@kgi259
@kgi259 2 жыл бұрын
It's worked to my project! Thanks a lot
@Kevin-HB
@Kevin-HB 3 жыл бұрын
Man, you help my life. THANK YOU SO MUCH!!!!!!
@aslammamud6078
@aslammamud6078 3 жыл бұрын
Your tutorial helped me a lot. thanks. all the best.
@constanzacirion8100
@constanzacirion8100 3 жыл бұрын
this is exactly what i was looking for. thanks :)
@aleksandrbut9604
@aleksandrbut9604 5 жыл бұрын
thanks a lot, this is exactly what i was looking for
@arunachalamk1145
@arunachalamk1145 5 жыл бұрын
keep doing bruh Great quality
@zadick2026
@zadick2026 5 жыл бұрын
Thank you so much bro it saves my time
@nawazkamboo8750
@nawazkamboo8750 2 жыл бұрын
you're awesome dude. Really it is the Best Practice Way!! My Issue was solved
@pikachubolt2001
@pikachubolt2001 4 жыл бұрын
Thanks mitch, the other tutorial on another guy on how to setup a recyclerview had miss one thing on how to implement the listener to get clickevents, he forgot to add view.setonclicklistener(this); on the customviewholder. thanks again!
@abdulazizfahim2140
@abdulazizfahim2140 3 жыл бұрын
Dude you are a LIFESAVER!!
@demoscena1180
@demoscena1180 5 жыл бұрын
Interesting. I was always using the "bad practice" way.
@javrz91
@javrz91 4 жыл бұрын
Excellent! This really helped a lot! Thanks!
@nonamenoname3144
@nonamenoname3144 2 жыл бұрын
Thank you very much, you make me understand interfaces
@darshans9186
@darshans9186 5 жыл бұрын
Oh shitt!! Have to make lots of changes in the code which I wrote today 😅 thanks alot mate. It's really helpful. Keep posting good stuff
@codingwithmitch
@codingwithmitch 5 жыл бұрын
I think next month I'm going to start posting shitty stuff
@casenovo
@casenovo 3 жыл бұрын
Awesome Work Dude. Really Appreciate it.
@samoramabuya6583
@samoramabuya6583 3 жыл бұрын
Listen to me now. Thanks bro. This helped me with a problem I was having.
@LiubomyrFatsiievych
@LiubomyrFatsiievych 2 жыл бұрын
Great tutorial, thank u so much!
@marenlampprecht6947
@marenlampprecht6947 4 жыл бұрын
Wow!!! This is a great tutorial! Thank you :)
@gyuhyunchoi1941
@gyuhyunchoi1941 2 жыл бұрын
thanks for the great video! 👍
@lemmynjaria65
@lemmynjaria65 3 жыл бұрын
Awesome!!! thanks a bunch
@enriqueajin6016
@enriqueajin6016 3 жыл бұрын
Helped a lot. Thank you :)
@andre0667
@andre0667 2 жыл бұрын
Straight to the point!
@john20johnny
@john20johnny 4 жыл бұрын
Hi, first I'd like to thank you for your videos and lessons, and then I got two questions that I hope you have time to answer. 1. How to make each item to open a new activity (not the same) example item (A) opens activity (A) and item (B) opens activity (B) and so on. 2. How to implement onBackPressed() or finish() method in the clickListener method of recyclerView, for example if item (A) clicked open activity (A) and finish its current activity. Thank you again.
@hocineguebbas4016
@hocineguebbas4016 4 жыл бұрын
Thank you so match . you're the best ever.
@vuphong2003
@vuphong2003 4 жыл бұрын
Clearly explained, plus you made it so easy. Thanks!
@rishankyashu1121
@rishankyashu1121 4 жыл бұрын
wow..... nice explained iwas stuck on this problem for more than a day.....
@DrHoffVan
@DrHoffVan 5 жыл бұрын
thanks for the new and optimal way thanks a lot
@prithvib8662
@prithvib8662 3 жыл бұрын
Your voice makes this sound like casually explained: programming
@farnadtohidkhah1684
@farnadtohidkhah1684 2 жыл бұрын
Thank you very much for your decent video
@soja0524
@soja0524 5 жыл бұрын
It was such a great explaination. Thanks1
@isurubandara899
@isurubandara899 3 жыл бұрын
Thank you man, I have been using the wrong one that you mentioned. I did not know that Thank you again.
@MijanurRahman-jo1st
@MijanurRahman-jo1st 5 жыл бұрын
your video is the best,thanks a lot
@tanzimislam2395
@tanzimislam2395 4 жыл бұрын
Ty ma frnd. You have earned yourself a subscriber
@sergeykuzmin8566
@sergeykuzmin8566 4 жыл бұрын
Thank you so much. It helped me with my project
@hectorfabianvignolo9960
@hectorfabianvignolo9960 4 жыл бұрын
Mil gracias desde Argentina!!!
@KapilTapsi
@KapilTapsi 4 жыл бұрын
Superb. Thank you sir. Very good tutorial
@alpertemell
@alpertemell 4 жыл бұрын
thanks, i implemented it to my code easily.
@LoneAnimatorAnimations
@LoneAnimatorAnimations 4 жыл бұрын
Thank-you!!! You should know, you're great!
@emmanuelU17
@emmanuelU17 3 жыл бұрын
Thank you for this video
@anshusharma5095
@anshusharma5095 5 жыл бұрын
thankyou so much ..it works ...hurryyyyy
@rishabh6904
@rishabh6904 4 жыл бұрын
Thanks a lot and God Bless!!!
@vitalykrivolapov3163
@vitalykrivolapov3163 4 жыл бұрын
Thank you very much! Very helped.
@andrewfielden284
@andrewfielden284 4 жыл бұрын
Nice video. Very well explained.
@modelonh
@modelonh 3 жыл бұрын
Great vid, thanks!
@andreslista4079
@andreslista4079 5 жыл бұрын
Sir, great video. Thank you. Greetings from Venezuela!
@azammukhtar9011
@azammukhtar9011 5 жыл бұрын
Lol, i just wondering how to do that tommorow, very nice thank you !
@iAdrianT
@iAdrianT 5 жыл бұрын
Literally same LMAO
@milleniumtv908
@milleniumtv908 4 жыл бұрын
This helped me a lots! Thanks very much
@codingwithmitch
@codingwithmitch 4 жыл бұрын
No problemo
@sachindeshapande7888
@sachindeshapande7888 5 жыл бұрын
It's working... Thank you
@sergozubarev1153
@sergozubarev1153 3 жыл бұрын
The best decision!!!! Thnx
@tek-f697
@tek-f697 Жыл бұрын
Great video!
@addinninggar1775
@addinninggar1775 4 жыл бұрын
this really help mee thank uu !!
@krispinugget
@krispinugget 4 жыл бұрын
Bruh Keep on Doing this, Love ya :)
@fabricioronison
@fabricioronison 4 жыл бұрын
Excellent
Sending Data to a New Activity with Intent Extras
8:21
CodingWithMitch
Рет қаралды 35 М.
RecyclerView Item Click | Best Practice Way
8:06
Practical Coding
Рет қаралды 92 М.
Каха и суп
00:39
К-Media
Рет қаралды 5 МЛН
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 43 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 95 МЛН
RecyclerView item Click using Interface | Advanced Way | Android
7:01
RecyclerView OnClickListener to New Activity
15:20
CodingWithMitch
Рет қаралды 214 М.
DO NOT do this in a Software Engineering Interview
7:59
CodingWithMitch
Рет қаралды 9 М.
RecyclerView in Android Studio using Kotlin | Android Knowledge
12:11
Android Knowledge
Рет қаралды 13 М.
RecyclerView | Everything You Need to Know
25:07
Practical Coding
Рет қаралды 130 М.
Why use Type and not Interface in TypeScript
14:12
ByteGrad
Рет қаралды 195 М.
Model View View-Model (MVVM): Getting Started
29:12
CodingWithMitch
Рет қаралды 397 М.
Каха и суп
00:39
К-Media
Рет қаралды 5 МЛН