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!
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.
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.
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
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) }
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....
I would not set a Clicklistener in viewHolder, because viewholder gets called multiple times. Instead, to it in onCreateViewHolder or onBindViewHolder.
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
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.
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
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?
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
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 } }
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.
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!
ua-cam.com/video/lWfQcchSUOQ/v-deo.html
After searching a lot, I finally found the right tutorial for me. Thanks a lot.
Happy to hear!
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.
Thank you! This helped so much
Great job brother it helped me !
Doesn't work anymore, it says it's deprecated :(
Any help?
I ended up assigning rv_recycleView as a variable to use the layout manager and adapter
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.
This solution is by far the cleanest one. Thank You!
Best tutorial... It's simple and easy to understand🤙
Oh, i was looking for a good examples and found it here, thank.
ua-cam.com/video/lWfQcchSUOQ/v-deo.html
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
ua-cam.com/video/lWfQcchSUOQ/v-deo.html
Thank you so much. Your explanation is clear and understandable. Thank you very much for simplified it. It's really helpful
Thanks, Code Palace. You helped me with my problem. The RecyclerViewer does exactly what it should.
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
I´m learning a lot with your channel. again thank you very much
It's a good quick start on a recyleview. Don't understand everything yet but this helps a lot
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
Thank you so much...it helped me
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)
}
I'll do some research and try to get back to you when I have time!
@@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)
}
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....
this comment has lot help me :D
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
Wait what? Idently made Android tutorials back in the days?
I just wan to say thanks for your help.
I would not set a Clicklistener in viewHolder, because viewholder gets called multiple times. Instead, to it in onCreateViewHolder or onBindViewHolder.
Can you please explain how to set click listeners to buttons inside cards..
Thanks for the video!!
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
Youre so underrated man... amazing content tho
ua-cam.com/video/lWfQcchSUOQ/v-deo.html
@@Yogesh-bp4vv yo, a nice channel
@@re_allyedge thank you.. bro..😊
Can't find rv_recycleView in 6:05
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
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.
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
@@shafiq824 Not working for me too :/ requiredActivity or Fragment doesnt exist
@@dennisbaumann2708 getActivity or something when the list show "Activity".
In which book u saw ways to add sample to recycler view ? Pls suggest
CAN I CHANGE THE TITLE,DESCRIPTION AND PICTURE INDIVIDUALLY FOR EVERY ITEM PLS ANSWER
How can I open fragment instead of show toast ?
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?
@@Yogesh-bp4vv thx buddy
YOU EARNED MY SUB
nice video!! my setOnClickListener doesn't work :( could it be because i'm using this in a fragment? idk i'm a newbie
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
How to create a searchView for this code?
ah yes, type what i type kind of video, very useful
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?
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
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
@@shafiq824 Exactly ! It can be something as simple as string resources or it can a full AWS database haha
adapter position is not working
Thank you! amazing :)
I can’t write setImageResource
Nice tutorial, I have used in my app, the app is crashing every time I run it. What should I do?
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
I'm getting "No adapter attached, skipping layout" error
Works for me, I had to use bindings so at 5:55 mine looks like binding.rvRecyclerView.layoutManager = LinearLayoutManager(this)
how to transfer data from recyclerview item that is clicked to another activity?
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
}
}
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
Thanks alot
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
Still working?
how do I add alertdialog inside the adapter??
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
me ajudou muito!!!
Need java Recycleview 🥺
5€
Check this ua-cam.com/video/lWfQcchSUOQ/v-deo.html
Hi it's a great tutorial overall but you are going too fast imo
For fast videos just change the playback speed in settings