Creating a RecyclerView that handles Click Events in Android Studio (Kotlin 2020)

Поділитися
Вставка
  • Опубліковано 4 лют 2025

КОМЕНТАРІ • 91

  • @thecodeimplementation3417
    @thecodeimplementation3417 4 роки тому +11

    Thanks, Code Palace. This short intro to RecyclerView is exactly what I needed. All the other tuts are like 40 minutes. Good luck with your channel.

  • @mordikowalski7304
    @mordikowalski7304 4 роки тому +1

    I just came for some onClick implementation and got a nice tools fo RecView too. Like... Im just impressed how fast and clear everything was explained here. Keep it going!

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @sushmoyr
    @sushmoyr 4 роки тому +3

    After searching a lot, I finally found the right tutorial for me. Thanks a lot.

  • @qwafochannel
    @qwafochannel 2 роки тому +3

    For any of you who had trouble assigning rv_recyclerView in MainActivity, your probably missing a common plugin that removes the need for capturing Views. It's in build.gradle(:app)
    plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
    }
    if your id 'kotlin-android-extensions' is missing then you need to add it and hit the sync now at the top of the code view. At least that solved the issue for me.
    You made a great tutorial sir.

    • @stagmanson4155
      @stagmanson4155 Рік тому +1

      Thank you! This helped so much

    • @highestdremas7654
      @highestdremas7654 Рік тому +1

      Great job brother it helped me !

    • @AngelaDionisieva
      @AngelaDionisieva 11 місяців тому

      Doesn't work anymore, it says it's deprecated :(
      Any help?

    • @TheAsurazero
      @TheAsurazero 3 місяці тому +1

      I ended up assigning rv_recycleView as a variable to use the layout manager and adapter

  • @nexgen.graphics
    @nexgen.graphics 3 роки тому +1

    You really made it quick, short and crispy. Simply loved it!. And I just passed this knowledge with someone today and felt much happier :). Thanks for this awesome tutorial.

  • @quiz36O
    @quiz36O 4 роки тому +2

    This solution is by far the cleanest one. Thank You!

  • @sumedchaus3565
    @sumedchaus3565 4 роки тому +2

    Best tutorial... It's simple and easy to understand🤙

  • @haventname2160
    @haventname2160 4 роки тому +2

    Oh, i was looking for a good examples and found it here, thank.

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @srivastav3684
    @srivastav3684 4 роки тому +10

    One suggestion: when you make more videos on android studio , just explain its function about how it works or why we need to use it etc. It will help us to understand it better and will be easier to memorize it. Thank you

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @rakharuan
    @rakharuan 4 роки тому +1

    Thank you so much. Your explanation is clear and understandable. Thank you very much for simplified it. It's really helpful

  • @ligonapProduktion
    @ligonapProduktion 4 роки тому

    Thanks, Code Palace. You helped me with my problem. The RecyclerViewer does exactly what it should.

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @MarianoAltuna
    @MarianoAltuna 4 роки тому +1

    I´m learning a lot with your channel. again thank you very much

  • @rushtothemax76
    @rushtothemax76 4 роки тому

    It's a good quick start on a recyleview. Don't understand everything yet but this helps a lot

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @polurukishorebabu8554
    @polurukishorebabu8554 2 роки тому +1

    Thank you so much...it helped me

  • @okan.e
    @okan.e 4 роки тому +6

    I need help about how to start an activity with Intent() in your RecyclerAdapter class.
    What I want to do is open an activity by clicking any list items. How do I do that? Could you help me? Thanks :)
    -edit: I found it:
    in init { } scope :
    itemView.setOnClickListener {
    val intent = Intent(itemView.context, yourActivity::class.java)
    intent.putExtra("value", "value")
    itemView.context.startActivity(intent)
    }

    • @Indently
      @Indently  4 роки тому

      I'll do some research and try to get back to you when I have time!

    • @okan.e
      @okan.e 4 роки тому +4

      @@Indently
      I've found it:
      in init { } scope:
      itemView.setOnClickListener {
      val intent = Intent(itemView.context, yourActivity::class.java)
      intent.putExtra("value", "value")
      itemView.context.startActivity(intent)
      }

    • @Sujoy2811
      @Sujoy2811 4 роки тому

      Bro, I dont know you but you made my day with this comment...
      In other videos , they made it in very complex way but you solved it in 3 lines...
      Thank you....

    • @MangPery
      @MangPery 4 роки тому

      this comment has lot help me :D

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @foxypiratecove37350
    @foxypiratecove37350 3 місяці тому

    Wait what? Idently made Android tutorials back in the days?

  • @RahmatKhanZai89
    @RahmatKhanZai89 4 роки тому

    I just wan to say thanks for your help.

  • @DerCheckerzeigts
    @DerCheckerzeigts 4 роки тому +1

    I would not set a Clicklistener in viewHolder, because viewholder gets called multiple times. Instead, to it in onCreateViewHolder or onBindViewHolder.

  • @shivanisanap9039
    @shivanisanap9039 4 роки тому +1

    Can you please explain how to set click listeners to buttons inside cards..
    Thanks for the video!!

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @re_allyedge
    @re_allyedge 4 роки тому +2

    Youre so underrated man... amazing content tho

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      ua-cam.com/video/lWfQcchSUOQ/v-deo.html

    • @re_allyedge
      @re_allyedge 4 роки тому

      @@Yogesh-bp4vv yo, a nice channel

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      @@re_allyedge thank you.. bro..😊

  • @idolevi612
    @idolevi612 2 роки тому

    Can't find rv_recycleView in 6:05

  • @TBrianOnline
    @TBrianOnline 4 роки тому +2

    Also, when I want to put the recycler into a fragment's code, I'm getting an error on having "this" in the rv_recyclerView.layoutManager = LinearLayoutManager(this) line

    • @shafiq824
      @shafiq824 4 роки тому

      Delete "this" and type word required. You pick the first list of choice based on the list given to you. I forgot it requiredActivity() or requiredFragment(). Something like that.

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

    • @dennisbaumann2708
      @dennisbaumann2708 4 роки тому

      @@shafiq824 Not working for me too :/ requiredActivity or Fragment doesnt exist

    • @shafiq824
      @shafiq824 4 роки тому

      @@dennisbaumann2708 getActivity or something when the list show "Activity".

  • @karthysbk6935
    @karthysbk6935 4 роки тому

    In which book u saw ways to add sample to recycler view ? Pls suggest

  • @differentdude8854
    @differentdude8854 3 роки тому

    CAN I CHANGE THE TITLE,DESCRIPTION AND PICTURE INDIVIDUALLY FOR EVERY ITEM PLS ANSWER

  • @trainmania100
    @trainmania100 3 роки тому

    How can I open fragment instead of show toast ?

  • @أميرالبلابل
    @أميرالبلابل 4 роки тому

    Great, but could somebody explain to me why we use to XML files why we did not put the textview and IMageView in same XML that contains Recycler?

  • @differentdude8854
    @differentdude8854 3 роки тому +1

    YOU EARNED MY SUB

  • @LuisMartinez-ku6is
    @LuisMartinez-ku6is 4 роки тому

    nice video!! my setOnClickListener doesn't work :( could it be because i'm using this in a fragment? idk i'm a newbie

  • @alexmemes2104
    @alexmemes2104 3 роки тому

    In RecyclerAdapter I have just add 2 line more
    init {
    itemView.setOnClickListener {
    val position:Int=adapterPosition
    ==> val blue= ContextCompat.getColor(itemView.context,R.color.blue)
    Toast.makeText(itemView.context,"Clicked On ${position +1}",Toast.LENGTH_SHORT).show()
    //itemTitle.setTextColor(blue)
    ==> itemView.setBackgroundColor(blue)
    }
    }
    but when i click on item 1 also item 10 and item 19 become blue
    and when i click on item 2 also item 11 and item 20 become blue
    when i click on item 3 also item 12 and item 21 become blue
    please give me a solution

  • @noonecaresbish
    @noonecaresbish 2 роки тому

    How to create a searchView for this code?

  • @youssh4975
    @youssh4975 3 роки тому

    ah yes, type what i type kind of video, very useful

  • @TBrianOnline
    @TBrianOnline 4 роки тому

    Hi, thank you! .This is a clean and comprehensible tutorial. I'd like to know how to populate the items with real data. Say I want to list profiles (name, description and photo) of couple of people. Where does it take the data from?

    • @shafiq824
      @shafiq824 4 роки тому +1

      you can set it hard coded, or create db from any db (eg : firebase, room or etc) or., you can parse it using retrofit take what type of data u want.
      i recommend using retrofit. he got all turorial here. he my sifu

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

    • @Exploremore658
      @Exploremore658 3 роки тому

      @@shafiq824 Exactly ! It can be something as simple as string resources or it can a full AWS database haha

  • @Newbie0341
    @Newbie0341 8 місяців тому

    adapter position is not working

  • @IsraelShai
    @IsraelShai 4 роки тому

    Thank you! amazing :)

  • @chalot001
    @chalot001 4 роки тому +1

    I can’t write setImageResource

  • @amritapandey413
    @amritapandey413 4 роки тому

    Nice tutorial, I have used in my app, the app is crashing every time I run it. What should I do?

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @arpitgupta3151
    @arpitgupta3151 3 роки тому

    I'm getting "No adapter attached, skipping layout" error

    • @Blackops1990
      @Blackops1990 3 роки тому

      Works for me, I had to use bindings so at 5:55 mine looks like binding.rvRecyclerView.layoutManager = LinearLayoutManager(this)

  • @hanadanefa7837
    @hanadanefa7837 4 роки тому

    how to transfer data from recyclerview item that is clicked to another activity?

    • @Indently
      @Indently  4 роки тому +3

      Hey man,
      in the adapter class you can try this
      init {
      ...
      ----- ADD SOMETHING LIKE THIS -----
      val i = Intent(itemView.context, SecondActivity::class.java) //create an intent for the activity you want
      i.putExtra("extra_info",position + 1) //add the information you want as an extra
      startActivity(itemView.context, i,null) //start the activity
      }
      }

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @jedidiaholadele2086
    @jedidiaholadele2086 4 роки тому +1

    Thanks alot

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @bigotes20random86
    @bigotes20random86 3 роки тому

    Still working?

  • @hanadanefa7837
    @hanadanefa7837 4 роки тому

    how do I add alertdialog inside the adapter??

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @Joao-xk1ws
    @Joao-xk1ws 3 роки тому +1

    me ajudou muito!!!

  • @mohammadsourov5650
    @mohammadsourov5650 4 роки тому

    Need java Recycleview 🥺

    • @Indently
      @Indently  4 роки тому +1

      5€

    • @Yogesh-bp4vv
      @Yogesh-bp4vv 4 роки тому

      Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html

  • @Dwika34
    @Dwika34 3 роки тому

    Hi it's a great tutorial overall but you are going too fast imo

    • @Blackops1990
      @Blackops1990 3 роки тому

      For fast videos just change the playback speed in settings