Click RecyclerView Item Android Studio (sending Click from Adapter to the Activity.java)
HTML-код
- Опубликовано: 27 ноя 2024
- in this video I show how to set an ItemClickListener for a RecyclerView and transfer the listener to the Activity.
Downloading the project resource code from GitHub:
github.com/Mor...
thank you for your tutorial. It helps me solve the problem that i got stuck for a week.
Superb Video and very Informative .... Keep It Up ....
Thanks a lot
you saved my project for the university! thanks a lot
It's nice. Good luck
wd u like to put ad native between cardview how can i do it?
If an activity have 50 nos of item in model class. I want to show only 3 items in recyceler card view and again 50 nos to another activity by clicking on item click litener. Is this possible ???
Yes, of course it's possible, there are diffrent methods to to that. You can create 2 diffrent views and adapters or you can can use one adapter and 2 views, hide the items and keep visible only 3. Second view can show all the items.
Brother please zoom text size because text looking very small in video so this is very hard for eyes. 🔥🔥🔥 And You are working awesome.
For sure, in my next video you'll see larger text size, thanks for suggestion.
Great tutorial!! I have a question and I wanted to implement that on my project, how will you put a custom back button on new detail activity so that whenever a user press on custom back button then it goes back to recycler view list items. ..? Can you please help me with that?
Please explain more. Where do you want to put custom button, into menu bar or somewhere else?
If you want to put it out side of menu bar, you need to setOnClickListener for that customize button. Inside the onClick method, you only need to call finish();
Then it gose back to previous activity. If you need more help, send me email on Morteza.habibzadeh.contact@gmail.com
@@intelligentcoding689 somewhere else.. not in the menu bar, not in the action bar , not in the UP navigation bar. Fully custom normal button that will work as a back button so that whenever a user press then it should go back to previous fragment that is where recycler view list items are .
But if I press back inside bottom panel, it does actually goes back to previous fragment. But I also want a custom back button.... I hope I explain well...
@@67Diadem there are 3 different scenarios,
1. When you have fragments and you need to undo the fragment. Then inside onClickListener, onClick, call onBackPressed(); then you get UNDO, untill all the actions go gack, then it gose to previous activity
2. You have fragments and with customized button, you just want to go back to previous Activity, so inside onClickListener, onClick, call finish();
3. You have no fragments to UNDO, then calling onBackPressed(); is enough to close the activity and gose back to previous one.
Hope I could help you. Cheers
@@intelligentcoding689 thank you. Let me try these and get back to you...
Hello friend good tutorial, I am new and I have a doubt, when clicking on the item but before it shows the next activity that shows an interstitial ad and then go to the activity, where would I put the ad code in the activity or in the adapter?
Greetings
Get the click on your activity (not in Adapter), save the position, show the full screen ad, then onAdDissmissedLisrtener, load position number and open the second activity there. If you don't know how to save position, see the below link.
ruclips.net/video/QzCAymfM2xE/видео.html
@@intelligentcoding689 Very well I understand, thanks for the help, your videos help a lot with the step by step way you explain, maybe you can create an advanced tutorial about recyclerView and native ads, but you are a great help bro,
Greetings and thanks for your help.
@@oscarvicente1654 I'm glad you like my video, I already made a video about Native ad in Recyclerview, see the below link
ruclips.net/video/qcC5XIp__ns/видео.html
@@intelligentcoding689 Wow you are great my friend, keep it up 🙌
Greetings!
You should make a course about android development
Update: Your app couldn't run. When I click on the images / buttons, the app auto shutsdown (crashes). I had to fix the manifest file.
can you create about when you click the button it will randomly display more than one pictures.. using java.. thank you
Please explain more. How you want to show the photos and from where you want to get them?
for example a clothes. which contains 3 categories tops, bottom and shoes and have different pictures of it in the database. when I click the button the app will the one to decide randomly what to show.. just like mix and match of clothes.. thank you
@@amandacallejo7401 it's very easy, you need to upload your photos in Firebase and create 3 different lists of photo links in your res/string.
Then by clicking on a button, pick up one link of each list and match them together. To show the photos on a link use Picasso library.
I mean the app will decide what pictures to show and random pictures will appear
@@amandacallejo7401 yes, I got your idea. I'll try to shoot a video about it. Right moment I'm so busy, but I'll keep your suggestion in my mind.
sir, tutorial 4 Mute This Ad for Native Ads plz ..
hello sir, this is a great tutorial! May I ask how can I get name etc of the current position if it comes from an api (coinmarketcap api)? because your recylcer view comes from the list.add . I am planning to create a crypto price tracker with recycler view and i want this to show in a new activity with the more detailed prices
See what variable do you have in your class. For my project, working like below example.
String mName = myList.get(position).getName():
It returns name from recyclerView
@@intelligentcoding689 thank you very much for responding. I fixed the problem that I was having! Keep on making tutorials!
@@yummytommyyy happy for you. Keep up
Can you make a video for Admob native template ads in Recycler view.
I already did, Please check the below link
ruclips.net/video/qcC5XIp__ns/видео.html
Bro please we want a video about EU Consent "GDPR AdMob"
Sure. I'll make it
@@intelligentcoding689
Thank you bro.. Please soon I will pubish a new app and waiting for you to add GDPR👨💻😘
@@amaral8906 great job. Good luck
Let's publish your app. You can add EU consent in further updates.
@@intelligentcoding689 yeah bro... Also we need GDPR to update 35 apps already publiahing😇😅
I will publish it... Then update all after video😁
can you share link for source code bro? bcs i cant read code in this video
The link is added in the video's description.
@@intelligentcoding689 thanks bro
how to OnClickListener firebase To New Activity ❤️🌹 We want the same but firebase ❤️🌹
Can we load html files in one webview by this Recycerview 🔥🔥🔥 if yes, please make a video on this topic
I think it's possible. Honestly I've never did it before
@@intelligentcoding689 with html files we can customise text and font styles in the better way. 🔥🔥
@@anoopmoji8768 yes, of course you can.
Make Video JSON TO Recycleview and Open New Activity image,name