RecyclerView With Item Click Listener in Kotlin : ( Android Tutorial 2022 )

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ม.ค. 2025

ความคิดเห็น • 55

  • @georget10i
    @georget10i ปีที่แล้ว +4

    Thank you! I think this is the cleanest solution I've found so far. You can implement a listener using an Interface, but this, in my opinion, is a cleaner solution. I am guessing this tutorial is aimed at somebody who is already familiar with Kotlin, hence why some parts are not explained. But if like myself, you are new to Kotlin, what he does at 12:30 is he declares a "function type" that takes an object of type food, and returns Unit (which is an equivalent of void in Java) and then he makes this function type nullable (hence the parentheses) and then initializes it to null. If you are coming from the C# world, it's basically an Action Delegate. I found that part confusing in the tutorial, so if you are in the same situation, I hope this explanation helps. Thanks again for the tutorial, CodingSTUFF!

  • @chanliol6626
    @chanliol6626 2 ปีที่แล้ว +10

    You are a savior. For days I've been trying several ways to move through my nav graph (fragments) using recyclerview clicklisteners and you just showed me the solution. Thanks a ton buddy. Awesome work.

  • @زيد_اليماني
    @زيد_اليماني ปีที่แล้ว

    I watched many video tutorials and all of them didn't work for me and they looked very complicated, unlike your video it's very easy to implement and works without problems really you are amazing

  • @sisoMK
    @sisoMK ปีที่แล้ว +3

    It works, just did it using fragments instead of activity because im using a navegation bottom bar. Works fine for me !

    • @marco6103
      @marco6103 ปีที่แล้ว

      can you tell me how you did it please?

  • @akhiltherock999
    @akhiltherock999 ปีที่แล้ว

    hello sir
    Explanation was great...i've searching whole youtube for like this video who could explain the concepts with simple constraints and with good explanation..
    Thank you so much sir

  • @enlost3052
    @enlost3052 2 ปีที่แล้ว +2

    It really helped me learn a lot. Simple and very beginner friendly .

  • @lglf77
    @lglf77 10 หลายเดือนก่อน +2

    your code is deprecated in news glades

  • @tofushiro3871
    @tofushiro3871 หลายเดือนก่อน

    Hello sir. I would like to ask how I should change the codes at the line
    if (food != null) {....}
    since my 2nd activity contains only fragment container view and no image nor text?

  • @nihalbahadir4262
    @nihalbahadir4262 ปีที่แล้ว

    çoook yardımcı oldu çok teşekkür ederim

  • @SajjadAli-hh9gq
    @SajjadAli-hh9gq 2 ปีที่แล้ว

    Excellent Work Sir

  • @EthelDawnPenaso
    @EthelDawnPenaso ปีที่แล้ว

    it worked thanks a lot!

  • @Mohit-il9gx
    @Mohit-il9gx 2 ปีที่แล้ว +3

    😶no words just "Thanks 🇮🇳 TH-camrs"

  • @did..you..know.
    @did..you..know. 2 ปีที่แล้ว +2

    Bro, why in main activity i cannot find onItemClick? Its just not there I cannot use it

  • @sisoMK
    @sisoMK 2 ปีที่แล้ว

    THANK YOU VER WELL DONE VIDEO, EASY TO FOLLOW

  • @rinorobot
    @rinorobot 2 ปีที่แล้ว

    great video, and very useful the clicklister with parcelable

  • @CHACHANUS
    @CHACHANUS ปีที่แล้ว

    thanks, very useful!! , new subscriber

  • @mertcankartal4453
    @mertcankartal4453 2 ปีที่แล้ว

    useful and clean explain thx dude

  • @NoeliaRedondo-bx5fm
    @NoeliaRedondo-bx5fm 2 ปีที่แล้ว

    Muchísimas gracias. Salvaste mi vida

  • @Elmdrassa2
    @Elmdrassa2 2 ปีที่แล้ว

    thanks bro , thats info what i search

  • @twinspast141
    @twinspast141 2 ปีที่แล้ว +1

    get parcelable extra is deprecated . Now what i can do??!! pls help sir

    • @mattdyor2040
      @mattdyor2040 2 ปีที่แล้ว

      Did you find an answer? Looks like there is an alternative version that has just a slightly different signature.

    • @sisoMK
      @sisoMK ปีที่แล้ว

      dont mind it, it works fine even if its deprecated

    • @sisoMK
      @sisoMK ปีที่แล้ว

      @@mattdyor2040 it works even with the deprecated

  • @rodelioliwag7627
    @rodelioliwag7627 2 ปีที่แล้ว

    Thank you very much. Very helpful

  • @noufelnaili1468
    @noufelnaili1468 ปีที่แล้ว

    bro can you please tell me what theme of android studio are you using and what emulator are you using ?

  • @ucvuphamanh3524
    @ucvuphamanh3524 ปีที่แล้ว

    very useful , thank you

  • @diskys8174
    @diskys8174 ปีที่แล้ว

    Nice work bro, u help me!

  • @gianlim3610
    @gianlim3610 9 หลายเดือนก่อน

    Thank you sir!

  • @Vtx-ex2bf
    @Vtx-ex2bf ปีที่แล้ว

    Do you have same type of video in java?

  • @mertcantopcu1351
    @mertcantopcu1351 2 ปีที่แล้ว

    i just want to When we click on an text or button in the detailedactivity section, I want it to go to a url page, how can I do it?

  • @JosephVillariasa
    @JosephVillariasa 8 หลายเดือนก่อน

    Whats the version of android studio of this sir?

  • @kohlishiva2135
    @kohlishiva2135 2 ปีที่แล้ว

    Thanx a lot bhaaai

  • @deepeshkumar1704
    @deepeshkumar1704 ปีที่แล้ว

    sir ads integration in recyclerview par video banaiye pls, and then reward and banner ads, pls

  • @shakymountain8834
    @shakymountain8834 4 หลายเดือนก่อน +1

    Thankyou so so much !

  • @desihiphop4998
    @desihiphop4998 2 ปีที่แล้ว

    what if i want different action on clicking the image of food and different action on clicking a whole view ???

    • @kundangupta1333
      @kundangupta1333 2 ปีที่แล้ว

      Same question 🙋 please help

    • @codingstuff070
      @codingstuff070  2 ปีที่แล้ว

      Add different click listeners one on imageview and one on whole itemview

    • @kundangupta1333
      @kundangupta1333 2 ปีที่แล้ว

      @@codingstuff070 okay,thank you sir

    • @desihiphop4998
      @desihiphop4998 2 ปีที่แล้ว

      @@kundangupta1333 you got how to do that ?

    • @kundangupta1333
      @kundangupta1333 2 ปีที่แล้ว +1

      @@desihiphop4998 yes,in place of itemview.setonCliclister just put imageid.setonclicklister {},I think this way we can implement

  • @Kw710v
    @Kw710v 2 ปีที่แล้ว

    how can i pass data between 2 recyclerview with firebase no one made video about this issue can you make video about this. If you dont want to make video about this issue can you tell me how can i pass data between 2 recyclerview with firebase

  • @wilwad
    @wilwad 2 ปีที่แล้ว

    Thank you 🙏

  • @vizliu
    @vizliu 2 ปีที่แล้ว

    Is it possible to make part of the text that we add to the list bold

  • @mibarcita3223
    @mibarcita3223 ปีที่แล้ว

    'getParcelableExtra(String!): T?' is deprecated. Deprecated in Java 😢😢😢😢😢😢

  • @АльфредАхметгалеев
    @АльфредАхметгалеев 2 ปีที่แล้ว

    super

  • @vizliu
    @vizliu 2 ปีที่แล้ว

    thank bro

  • @pgameboy8
    @pgameboy8 2 ปีที่แล้ว

    exelente parabéns!!!!!!!!

  • @ayanjamil8270
    @ayanjamil8270 ปีที่แล้ว

    I just wish there was a github link

  • @muhammadmykoa8768
    @muhammadmykoa8768 ปีที่แล้ว +1

    Show me your manifest, please!

  • @shaktisinghsonigara9094
    @shaktisinghsonigara9094 2 ปีที่แล้ว

    pls can you share source code.