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

Комментарии • 51

  • @chilllee7364
    @chilllee7364 2 года назад +1

    thank you for your tutorial. It helps me solve the problem that i got stuck for a week.

  • @sandeeppillai2890
    @sandeeppillai2890 2 года назад +1

    Superb Video and very Informative .... Keep It Up ....

  • @rafaelcabral6748
    @rafaelcabral6748 3 года назад +1

    you saved my project for the university! thanks a lot

  • @ContigoDios
    @ContigoDios 3 года назад +2

    wd u like to put ad native between cardview how can i do it?

  • @Sourav_8089
    @Sourav_8089 3 года назад +1

    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.

  • @anoopmoji8768
    @anoopmoji8768 3 года назад +1

    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.

  • @67Diadem
    @67Diadem 3 года назад +1

    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 года назад +1

      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 года назад +1

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

  • @oscarvicente1654
    @oscarvicente1654 3 года назад +2

    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 года назад +1

      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

    • @oscarvicente1654
      @oscarvicente1654 3 года назад +2

      @@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 года назад +1

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

    • @oscarvicente1654
      @oscarvicente1654 3 года назад +2

      @@intelligentcoding689 Wow you are great my friend, keep it up 🙌
      Greetings!

  • @المبتسمدائما-ن4غ
    @المبتسمدائما-ن4غ 3 года назад

    You should make a course about android development

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

  • @amandacallejo7401
    @amandacallejo7401 3 года назад +1

    can you create about when you click the button it will randomly display more than one pictures.. using java.. thank you

    • @intelligentcoding689
      @intelligentcoding689  3 года назад +1

      Please explain more. How you want to show the photos and from where you want to get them?

    • @amandacallejo7401
      @amandacallejo7401 3 года назад +1

      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 года назад +1

      I mean the app will decide what pictures to show and random pictures will appear

    • @intelligentcoding689
      @intelligentcoding689  3 года назад +1

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

  • @abah_aini
    @abah_aini 3 года назад +2

    sir, tutorial 4 Mute This Ad for Native Ads plz ..

  • @yummytommyyy
    @yummytommyyy 2 года назад +1

    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 года назад +1

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

  • @adiraiferoz
    @adiraiferoz 3 года назад +1

    Can you make a video for Admob native template ads in Recycler view.

    • @intelligentcoding689
      @intelligentcoding689  3 года назад +1

      I already did, Please check the below link
      ruclips.net/video/qcC5XIp__ns/видео.html

  • @amaral8906
    @amaral8906 3 года назад +2

    Bro please we want a video about EU Consent "GDPR AdMob"

    • @intelligentcoding689
      @intelligentcoding689  3 года назад

      Sure. I'll make it

    • @amaral8906
      @amaral8906 3 года назад +1

      @@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 года назад +1

      @@intelligentcoding689 yeah bro... Also we need GDPR to update 35 apps already publiahing😇😅
      I will publish it... Then update all after video😁

  • @naiffarhan4603
    @naiffarhan4603 3 года назад +1

    can you share link for source code bro? bcs i cant read code in this video

  • @Bmw-ky3mg
    @Bmw-ky3mg 3 года назад

    how to OnClickListener firebase To New Activity ❤️🌹 We want the same but firebase ❤️🌹

  • @anoopmoji8768
    @anoopmoji8768 3 года назад +1

    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 года назад +1

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