No video

Click RecyclerView Item Android Studio (sending Click from Adapter to the Activity.java)

  Рет қаралды 6,449

Intelligent Coding

Intelligent Coding

Күн бұрын

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...

Пікірлер: 54
@sandeeppillai2890
@sandeeppillai2890 2 жыл бұрын
Superb Video and very Informative .... Keep It Up ....
@intelligentcoding689
@intelligentcoding689 2 жыл бұрын
Thanks a lot
@chilllee7364
@chilllee7364 2 жыл бұрын
thank you for your tutorial. It helps me solve the problem that i got stuck for a week.
@rafaelcabral6748
@rafaelcabral6748 3 жыл бұрын
you saved my project for the university! thanks a lot
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
It's nice. Good luck
@ContigoDios
@ContigoDios 3 жыл бұрын
wd u like to put ad native between cardview how can i do it?
@user-jh7zx4jg1y
@user-jh7zx4jg1y 3 жыл бұрын
You should make a course about android development
@anoopmoji8768
@anoopmoji8768 3 жыл бұрын
Brother please zoom text size because text looking very small in video so this is very hard for eyes. 🔥🔥🔥 And You are working awesome.
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
For sure, in my next video you'll see larger text size, thanks for suggestion.
@anonymous-8001
@anonymous-8001 3 жыл бұрын
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.
@abah_aini
@abah_aini 3 жыл бұрын
sir, tutorial 4 Mute This Ad for Native Ads plz ..
@Sourav_8089
@Sourav_8089 3 жыл бұрын
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 ???
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
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.
@Bmw-ky3mg
@Bmw-ky3mg 2 жыл бұрын
how to OnClickListener firebase To New Activity ❤️🌹 We want the same but firebase ❤️🌹
@qasiahputri9496
@qasiahputri9496 2 жыл бұрын
Hi sir, thank you so much for this tutorial, but may I ask you, what if I use firebase as database, and I want to retrieve the data to the card view in the recycler view, and I want to make an on click item listener to move to another activity and show a picture, I really hope you will answer this, it's for my final project Thanks in advance
@intelligentcoding689
@intelligentcoding689 2 жыл бұрын
Go to the adapter, and upgrade the OnItemClick for photo link: public interface OnRecyclerViewClickListener{ void OnItemClick(int position, String link); } then: itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(listener!=null && getAbsoluteAdapterPosition()!=RecyclerView.NO_POSITION){ listener.OnItemClick(getAbsoluteAdapterPosition(), yourPhotoLink); } } }); then go to the Activity, to the place you get back listener: adapter.OnRecyclerViewClickListener(new MyAdapter.OnRecyclerViewClickListener() { @Override public void OnItemClick(int position, String link) { Intent intent = new Intent(Activity1.this, Activity2.class); intent.putExtra("myLink", link); startActivity(intent); } }); in Activity2: String link = getIntent().getStringExtra("myLink"); // Use the link to load the photo and place it in to an imageView
@qasiahputri9496
@qasiahputri9496 2 жыл бұрын
okay, thanks a lot sir
@amandacallejo7401
@amandacallejo7401 3 жыл бұрын
can you create about when you click the button it will randomly display more than one pictures.. using java.. thank you
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
Please explain more. How you want to show the photos and from where you want to get them?
@amandacallejo7401
@amandacallejo7401 3 жыл бұрын
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
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
@@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.
@amandacallejo7401
@amandacallejo7401 3 жыл бұрын
I mean the app will decide what pictures to show and random pictures will appear
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
@@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.
@oscarvicente1654
@oscarvicente1654 3 жыл бұрын
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
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
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. kzfaq.info/get/bejne/h-BzdNyey7OWqHk.html
@oscarvicente1654
@oscarvicente1654 3 жыл бұрын
@@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.
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
@@oscarvicente1654 I'm glad you like my video, I already made a video about Native ad in Recyclerview, see the below link kzfaq.info/get/bejne/p8lzaLt61cXDnqc.html
@oscarvicente1654
@oscarvicente1654 3 жыл бұрын
@@intelligentcoding689 Wow you are great my friend, keep it up 🙌 Greetings!
@adiraiferoz
@adiraiferoz 3 жыл бұрын
Can you make a video for Admob native template ads in Recycler view.
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
I already did, Please check the below link kzfaq.info/get/bejne/p8lzaLt61cXDnqc.html
@67Diadem
@67Diadem 3 жыл бұрын
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?
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
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
@67Diadem
@67Diadem 3 жыл бұрын
@@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...
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
@@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
@67Diadem
@67Diadem 3 жыл бұрын
@@intelligentcoding689 thank you. Let me try these and get back to you...
@amaral8906
@amaral8906 3 жыл бұрын
Bro please we want a video about EU Consent "GDPR AdMob"
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
Sure. I'll make it
@amaral8906
@amaral8906 3 жыл бұрын
@@intelligentcoding689 Thank you bro.. Please soon I will pubish a new app and waiting for you to add GDPR👨‍💻😘
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
@@amaral8906 great job. Good luck
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
Let's publish your app. You can add EU consent in further updates.
@amaral8906
@amaral8906 3 жыл бұрын
@@intelligentcoding689 yeah bro... Also we need GDPR to update 35 apps already publiahing😇😅 I will publish it... Then update all after video😁
@yummytommyyy
@yummytommyyy 2 жыл бұрын
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
@intelligentcoding689
@intelligentcoding689 2 жыл бұрын
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
@yummytommyyy
@yummytommyyy 2 жыл бұрын
@@intelligentcoding689 thank you very much for responding. I fixed the problem that I was having! Keep on making tutorials!
@intelligentcoding689
@intelligentcoding689 2 жыл бұрын
@@yummytommyyy happy for you. Keep up
@naiffarhan4603
@naiffarhan4603 3 жыл бұрын
can you share link for source code bro? bcs i cant read code in this video
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
The link is added in the video's description.
@naiffarhan4603
@naiffarhan4603 3 жыл бұрын
@@intelligentcoding689 thanks bro
@anoopmoji8768
@anoopmoji8768 3 жыл бұрын
Can we load html files in one webview by this Recycerview 🔥🔥🔥 if yes, please make a video on this topic
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
I think it's possible. Honestly I've never did it before
@anoopmoji8768
@anoopmoji8768 3 жыл бұрын
@@intelligentcoding689 with html files we can customise text and font styles in the better way. 🔥🔥
@intelligentcoding689
@intelligentcoding689 3 жыл бұрын
@@anoopmoji8768 yes, of course you can.
@arvindmistry2949
@arvindmistry2949 3 жыл бұрын
Make Video JSON TO Recycleview and Open New Activity image,name
RecyclerView | Everything You Need to Know
25:07
Practical Coding
Рет қаралды 133 М.
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 28 МЛН
Look at two different videos 😁 @karina-kola
00:11
Andrey Grechka
Рет қаралды 14 МЛН
Comfortable 🤣 #comedy #funny
00:34
Micky Makeover
Рет қаралды 16 МЛН
SPILLED CHOCKY MILK PRANK ON BROTHER 😂 #shorts
00:12
Savage Vlogs
Рет қаралды 46 МЛН
How This New Battery is Changing the Game
12:07
Undecided with Matt Ferrell
Рет қаралды 110 М.
Communicating Back from RecyclerView Adapter to Activity or Fragment
7:21
Scammed selling my MacBook, almost
15:09
Alex Ziskind
Рет қаралды 37 М.
RecyclerView OnClickListener (Best practice way)
11:48
CodingWithMitch
Рет қаралды 291 М.
RecyclerView Item Click | Best Practice Way
8:06
Practical Coding
Рет қаралды 93 М.
RecyclerView item Click using Interface | Advanced Way | Android
7:01
Multi view RecyclerView | getItemViewType() | Android
15:03
Mafia Codes
Рет қаралды 38 М.
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 28 МЛН