Filter RecyclerView by placing a SearchView on Toolbar

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • This video demonstrate how to filter items on a RecyclerView by using a SearchView on the Toolbar.
    Like my Facebook page : / codeglympse
    Subscribe My RUclips channel : / ticoontechnologies

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

  • @joetke
    @joetke 7 лет назад

    Thanks a lot Prabeesh, your lessons are helpful, pretty instructive, clear and have a real pedagogical consistency. Thank you Sir. They save me a huge amount of time.

  • @shahoodgmail
    @shahoodgmail 6 лет назад

    After watching a lot of crap, finally found something useful. Thanks for the nice tutorial. In my case, the recyclerView contains a lot of views and it pulls data from an API. Will try to use the basic guidelines in this video and implement the searchView. If i come across any issue, would get back to u. Thanks again!

  • @raduthlucian
    @raduthlucian 7 лет назад

    Many thanks! Very good explanation and easy to follow tutorial.

  • @sam_making_games
    @sam_making_games 5 лет назад

    Thanks, you saved me a lot of time.

  • @surajchavan1000
    @surajchavan1000 7 лет назад

    Thank you so much for such straightforward tutorial sir.

  • @samimanasrin8230
    @samimanasrin8230 6 лет назад

    I just love this channel.... Best Tutorial Ever

  • @christianjabba4986
    @christianjabba4986 7 лет назад

    Excellent Bro. Good luck, I served a lot. Very good tutorial.

  • @fransringo323
    @fransringo323 7 лет назад

    Thanks again Mr.Prabeesh. U help my problem a lot!

  • @sitaramgangode912
    @sitaramgangode912 4 года назад +1

    Thank you sir, This is very helpful tutorial for me as i was disparately struggling to get it done. Now my recycle view responses perfectly. But I need some more help. I want to open new different new activities by clicking the list. So, I think I should use switch case. But I don't know how to do it. I have coded my codes just as your codes. Please guide.

  • @Navarroski316
    @Navarroski316 7 лет назад

    Excellent tutorial. Thanks.

  • @DronzerTV
    @DronzerTV 7 лет назад

    Thank you, your video helped solving my problem.

  • @stephaniegarcia3861
    @stephaniegarcia3861 7 лет назад

    Hello, I've not yet finished the tutorial, but I would like to thank you since this was very helpful to my project I'm doing to finish my degree :)

  • @badakml7366
    @badakml7366 7 лет назад

    waw, simple and works perfectly, tq sir, really appreaciate this tutorial

  • @shahrukhbaig6760
    @shahrukhbaig6760 7 лет назад

    Thank you soo much Mr . Prabeesh RK
    I implemented this on fragment and its working fine

    • @JudahDevasahayam111199
      @JudahDevasahayam111199 7 лет назад

      How did you implement it in fragment class? I tried but it doesn't work.

  • @norrisdamianus5250
    @norrisdamianus5250 7 лет назад

    Very nice tutorial

  • @siyabongazikhali2814
    @siyabongazikhali2814 7 лет назад

    Thank you very much, this tutorial was very helpful hey.
    I've been struggling to figure this out.

  • @muhannddh
    @muhannddh 7 лет назад +5

    Thank you so much for the tutorial , How to get the correct position of recyclerView after search filter has been applied ?

    • @todoestech
      @todoestech 7 лет назад

      Could you solve your doubt ?. you can help me

    • @shahoodgmail
      @shahoodgmail 6 лет назад +1

      After applying the search filter, the adapter should contain the new arraylist of filtered results. Means adapter should already have the positions of the new list.

    • @puneteleinfrapvtltd9532
      @puneteleinfrapvtltd9532 6 лет назад

      Sir i have problem My new list is filter but not show on adapter.

  • @SAURABH1691992
    @SAURABH1691992 7 лет назад

    Hello...that was awesome tutorial...implemented it correctly... can you please similarly show tutorial of how to do lazy loading of items in recyclerview with progress bar in the bottom when we are requesting for more data...?

  • @sabrinaanne2300
    @sabrinaanne2300 7 лет назад

    This is really helpful. Thanks a lot!!

  • @ziaurrehman5206
    @ziaurrehman5206 7 лет назад

    very nice. good work. keep it up.

  • @somphopcheyklinthet3331
    @somphopcheyklinthet3331 7 лет назад

    Thanks you so much.

  • @julioalvarado1833
    @julioalvarado1833 7 лет назад

    Gracias por el video!

  • @pedrososa1027
    @pedrososa1027 6 лет назад

    Thank you so much for the tutorial :3

  • @Manishkumar-we9qb
    @Manishkumar-we9qb 6 лет назад

    You are great sir...

  • @andhikasentanu960
    @andhikasentanu960 7 лет назад

    I want to like your videos more than once, but I can't. Thanks. from Indonesia.

  • @sushilkumargouda8101
    @sushilkumargouda8101 7 лет назад

    thank you sir ,thanks a lot it works for me

  • @peterukeme9181
    @peterukeme9181 5 лет назад

    Thank u sir. I really ur tutorial.
    Pls sir I'm suggesting that u should come up with tutorial on how to build a chat room. That will indicate when a new user has joined n left the chat... Thank u

  • @redsdailygulo7123
    @redsdailygulo7123 6 лет назад +1

    Can I use this if the recycler view content comes from online database? btw, Thanks for the tutorial.

  • @isaacferreira5615
    @isaacferreira5615 6 лет назад

    Thank you so much, very good

  • @voicheci007
    @voicheci007 7 лет назад

    Great tutorial ! Keep it up!

  • @MOHSEN.A77
    @MOHSEN.A77 5 лет назад

    خیلی عشقی یره

  • @rushidesai2836
    @rushidesai2836 6 лет назад

    Great tutorial Sir!

  • @mgroups
    @mgroups 7 лет назад

    very pronunciation of English, but excellent knowledge in Android... :) superb knowledge

  • @mirzajaun
    @mirzajaun 7 лет назад

    Thanks Sir, nice tutorial (y)

  • @xuanduyang4434
    @xuanduyang4434 7 лет назад

    thanks you. i have unit very good.

  • @JamsMendez
    @JamsMendez 7 лет назад

    great video, thank

  • @abdullahjaved2940
    @abdullahjaved2940 5 лет назад

    How to implement this search filter for a fragment. Hopefully you will answer this question.

  • @sirvanalie8093
    @sirvanalie8093 7 лет назад +1

    Hi man. Thanks for good tutorial. Now my question is when the user clicks on a back button or * icon for deleting search text must show all items, not that searched. When press back button, all items show.

  • @My_Name_Is_Prashant
    @My_Name_Is_Prashant 7 лет назад

    thank you very much sir.....

  • @mihaigaming
    @mihaigaming 7 лет назад +1

    Can you please do a tutorial for handling click for the items that are in RecyclerView when they switch position with SearchView.

    • @syalchdev3667
      @syalchdev3667 7 лет назад

      the setFilter creates a new list with the values that match the search, so the only thing you need to do is to add the listener inside the onbind method:
      ex:
      public void onBindViewHolder(final MyViewHolder holder, final int position) {
      final MangaCommon alObj = arrayList.get(position);
      @Override
      public void onClick(View v) {
      Toast.makeText(holder.itemView.getContext(),arrayList.get(position).getName(),Toast.LENGTH_SHORT).show();
      }
      });
      }

    • @mihaigaming
      @mihaigaming 7 лет назад

      Thanks man, i figured it out eventually!
      @Override
      public void onBindViewHolder(final Cars_ViewHolder holder, final int position) {
      holder.Image.setImageResource(arrayList.get(position).getPicture());
      holder.Denumire.setText(arrayList.get(position).getDenumire());
      holder.itemView.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
      Toast.makeText(holder.itemView.getContext(), arrayList.get(holder.getAdapterPosition()).getDenumire(),Toast.LENGTH_SHORT).show();
      }
      });
      }

  • @todoestech
    @todoestech 7 лет назад +1

    Hi, I have a doubt. As actions on the item search result? For example wants to show me a Toast for me to continue my development of leading to activity details

  • @reapergrim5324
    @reapergrim5324 6 лет назад

    helped me thank you.

  • @Bajaji12
    @Bajaji12 7 лет назад

    thank u so so much Eng.

  • @madhurmadan7018
    @madhurmadan7018 6 лет назад

    Please make next tutorial to get data from server using volley and get visible recycler view on search only. It will be very helpful.

  • @androiddeveloper5134
    @androiddeveloper5134 7 лет назад

    thanks for the video how can i programmatically click toolbar search icon ??

  • @AleksisDorsey
    @AleksisDorsey 7 лет назад

    THANK YOU!

  • @DNAMobileGaming
    @DNAMobileGaming 7 лет назад

    How do you handle each item so when you click india it goes to india activity or canada when clicked goes to canada activity etc? Thanks hopefully I'll figure it out before hand

    • @radzpage2122
      @radzpage2122 7 лет назад

      inside your RecycleViewAdapter class
      public void onBindViewHolder(final ViewHolder holder, final int position) {
      ...
      holder.linearLayout.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
      //Toast.makeText(context, "get your view here", Toast.LENGTH_SHORT).show();
      //or you may use a broadcast intent to call other activities.
      }
      });
      ...
      }
      Note: linearLayout here is the id of my LinearLayout which contain my CardView, TextView, ImageView etc...

  • @gardenhouse8601
    @gardenhouse8601 7 лет назад

    Hi prabheesh, Will you please make video on Google Maps for Plotting a route between two locations. Am following all your videos at the same time you drop any topic am facing the problems in that topic. Please , Please make a video on Google Map Directions.

  • @tdev_s
    @tdev_s 6 лет назад

    Thanks! :D

  • @AviPars
    @AviPars 7 лет назад

    Which search algorithm did you use?

  • @poojapatwa217
    @poojapatwa217 7 лет назад

    my question is that if click the plus or minus button from recyclerview or textview then how to update the badge in actionbar???

  • @kartikkartik9803
    @kartikkartik9803 7 лет назад

    Sir can i know how to implement search on the listview were the cradview is inflated on it with the sidebar search ,were cardview contains names of employee which are taken by making rest call and set on the cardview through adapter,now i want to make search by employee name on card so that the card which have searched should be displayed,am not getting how to proceed with it.

  • @amoluge1436
    @amoluge1436 6 лет назад

    Nice and thanks Sir,
    Dear Sir,
    How to add search view for button with webview activity.
    please sow any examples.

  • @Sampelmind81
    @Sampelmind81 4 года назад

    Hello, iam confused, i followed your instruction but in the onQueryTextChange i get an ConcurrentModificationException in the start of the for-loop and the app crashes. Any ideas? Thanks!

  • @JudahDevasahayam111199
    @JudahDevasahayam111199 7 лет назад

    I have a class called Lyrics and I have initialised a String[] variable songNames, How should I filter results for this variable in MyFragment class

  • @bufomarinus5494
    @bufomarinus5494 7 лет назад

    Hello , stupid question : why are my arrayList and adapter variable not found in my MainActivity. Thx for help :x

  • @roopeshitagi2048
    @roopeshitagi2048 7 лет назад

    can u please make a video for taking input from user through edittext field and on click os search button it should filter results to recycler view.. please help me out ..

  • @NeerajGupta-of9fy
    @NeerajGupta-of9fy 7 лет назад

    sir i have a problem regrading tab activity how can set filter in each fragment containing list please help me as soon

  • @justinjose5338
    @justinjose5338 7 лет назад

    hello sir.. how to search for a data in database by using searchview. That is i want to check the searchview typed data is present in a database??

  • @todayswwe5074
    @todayswwe5074 7 лет назад

    Dear sir, I get an error "Method doesn't override" & "unable to resolve symbol Menu' with my code in MainActivity.java while writing onCreateOptionsMenu class. What could be the reason?. I followed every step correctly.

  • @venuperumalla7057
    @venuperumalla7057 7 лет назад

    Thanks alotttttttttt

  • @sujaffaralikhan6385
    @sujaffaralikhan6385 6 лет назад

    Sir if the user input value is not available in list how to show a basic toast that no item present ?

  • @saifurrehman8361
    @saifurrehman8361 7 лет назад

    i have a grid items above to my list , i want when i click on grid if search is opened , it will close.....

  • @somaravi4115
    @somaravi4115 7 лет назад

    Sir can u explain autocomplete textview using adapter

  • @SuperHuznie
    @SuperHuznie 7 лет назад

    Thanks cuy

  • @ommishra7436
    @ommishra7436 6 лет назад

    thanks sir

  • @saifurrehman8361
    @saifurrehman8361 7 лет назад

    means how can i call close or clear focus ?

  • @peterukeme9181
    @peterukeme9181 5 лет назад

    And some feature where the user can change text color of their chat room

  • @dipanshumaheshwari7531
    @dipanshumaheshwari7531 7 лет назад

    How do you add a SearchView to a fragment? or how do you Filter a recycler view which is in a fragment? Please help.

  • @AsifAhmad-ox1yq
    @AsifAhmad-ox1yq 7 лет назад

    I'm new to android development, i want to set on click listener when any items in the recycler view is clicked, How to do it?? i searched few tutorials but i was not able to set it, Please help me.....

  • @kavyasrigurram7022
    @kavyasrigurram7022 6 лет назад

    Sir how can i add on scroll listener along with search view

  • @ashokthallapally6357
    @ashokthallapally6357 5 лет назад

    How to make clickable before and after filter

  • @rpitpatel1004
    @rpitpatel1004 7 лет назад

    last portionof the video ( search and create new list ) is complicated and how can i fire click event???

  • @ajiteshsingh3764
    @ajiteshsingh3764 7 лет назад

    if i use onclick method on the filter it gives the detailview based on the original position how do i solve this problem

  • @sayarsamanta713
    @sayarsamanta713 7 лет назад

    PRABEESH Sir My search view is not expanding.I have specifically done the same way you did,but still not working....

  • @Mse7enra
    @Mse7enra 7 лет назад

    sir can you share the code , great video

  • @AKSKMY
    @AKSKMY 6 лет назад

    Can anyone tell me how to create onClickListener and intent it to another activity after search has been done? I cannot use listview as you have not done a video that removes the default action bar and replace it with toolbar_layout. My app will crash when I try to bring it back via styles.xml @PRABEESH R K

  • @marcmecua4215
    @marcmecua4215 7 лет назад

    Sir, I have some question. I tried to combine your 2 tutorials (This one and also the onclick handler for recycler view). So when I run the project, it displays the lists correctly, and when I also try to search, it also accurately displays what I am searching for. But, on the searchview, after I searched for a certain country, after clicking it, it displays a different country than the one I was expecting to.

    • @PRABEESHRK
      @PRABEESHRK  7 лет назад +1

      When you filter it ,the position of each item changes in adapter and when you click it, it may get the name from the arraylist. In array list there is a different item on that corresponding position. That's why it display different country name.

    • @marcmecua4215
      @marcmecua4215 7 лет назад

      It has no error but my the logic for the onclick is wrong so I am getting a different output. This is the whole code for the onclick:
      public void onClick(View v) {
      int position = getAdapterPosition();
      Country country = this.country.get(position);
      Intent intent = new Intent(this.ctx,ContactDtalis.class);
      intent.putExtra("img_id",country.getFlag_id());
      intent.putExtra("name",country.getName());
      intent.putExtra("def",country.getDef());
      this.ctx.startActivity(intent);
      }
      Thank you sir for replying. I'm only new in this language sorry for asking help.
      Edit: I saw people saying you need to Filter/reset your recycleview. Can you share some ideas on how to do this?

    • @marcmecua4215
      @marcmecua4215 7 лет назад

      sir I still couldn't make a solution for it. Pls share a solution. Thank you

  • @amineboumahdi6138
    @amineboumahdi6138 6 лет назад

    SearchView OnCloseListener doesn't work. Any suggestion. Thanks in advance

  • @Cute_Girl_Thanvi
    @Cute_Girl_Thanvi 7 лет назад

    sir can u explain nested tab

  • @ucthecreation
    @ucthecreation 7 лет назад +1

    i am currently having a error with the adapter.setFilter(newlist); line. the setFilter is underlined. How do I fix it? thats the only error i have obtained so far

    • @devpune6953
      @devpune6953 7 лет назад +1

      Did you resolve the setfilter Method error? Pls share the code

    • @PRABEESHRK
      @PRABEESHRK  7 лет назад

      I think you create a wrong class object for the adapter. If you create object for RecyclerView.Adapter it is not possible to call the setFilter method method. Here you need to create the object of our custom adapter class because the setFilter method is in our custom adapter class.

    • @nyrplayer
      @nyrplayer 7 лет назад

      I had the same problem and then did this and it worked! Thank you!!!

    • @mahumpervez8456
      @mahumpervez8456 6 лет назад +1

      Convert RecyclerView.Adapter adapter; to RecyclerAdapter adapter;
      Worked for me :)

  • @josegarrido6982
    @josegarrido6982 7 лет назад

    i have a problem when i try to click on onebof the item, it selects a diferent items, how can i solve that, i think it is something with the "get(position), please help

    • @ajiteshsingh3764
      @ajiteshsingh3764 7 лет назад

      did you find the solution?

    • @adityamahajan5841
      @adityamahajan5841 7 лет назад

      yes u have to reset the recyclerView when the search list appears. for this click link below.
      anilandroid123.blogspot.in/2016/07/android-filter-recyclerview-using.html

    • @marcmecua4215
      @marcmecua4215 7 лет назад

      How do apply it for this line of code?
      public void onClick(View v) {
      int position = getAdapterPosition();
      Country country = this.country.get(position);
      Intent intent = new Intent(this.ctx,ContactDtalis.class);
      intent.putExtra("img_id",country.getFlag_id());
      intent.putExtra("name",country.getName());
      intent.putExtra("def",country.getDef());
      this.ctx.startActivity(intent);
      }

  • @NeerajKumar-ys8wm
    @NeerajKumar-ys8wm 5 лет назад

    Sir Adapter me jaha setFilter kiye hai uske aage country nahi smjh aaya kaise likha h

  • @imamsubarkah2795
    @imamsubarkah2795 7 лет назад

    is it can be apply in listview ?

    • @danman296
      @danman296 7 лет назад +3

      you shouldn't use listView. It is almost deprecated

  • @ektaparmar6622
    @ektaparmar6622 7 лет назад

    Hello sir,
    Nice tutorial
    I want to filter the name that is fetched from sqlite database in recycler view, can you plz make tutorial about it?

  • @sharadtawde5902
    @sharadtawde5902 7 лет назад

    Sir how to add google search bar in web view like google app

  • @gaganalakruwan2194
    @gaganalakruwan2194 5 лет назад

    No errors for me.but not work,item show in RecyclerView. but does not filter that data

  • @voicheci007
    @voicheci007 7 лет назад

    Can you make a tutorial about a Firebase Messaging App? Thank you very much

    • @PRABEESHRK
      @PRABEESHRK  7 лет назад +1

      I already have a new Firebase Tutorial Series....

  • @whiteking80
    @whiteking80 7 лет назад

    Would you share the code...

  • @justinjohn93
    @justinjohn93 7 лет назад

    I can see only 1 image any solutions?

  • @queroin
    @queroin 7 лет назад

    I got a little lost in 17:39.
    "LinearLayoutManager(android.content.Context) in LinearLayoutManager cannot be applied to android.support.v7.widget.RecyclerView.LayoutManager)"
    Above is the error that I can't debug please help me PRABEESH.

    • @queroin
      @queroin 7 лет назад

      Solve it sorry. Poor eyesight. it should be "layoutManager = new LinearLayoutManager(this);" not "layoutManager = new LinearLayoutManager(layoutManager);"
      sorry my bad.

  • @tusarsoni4739
    @tusarsoni4739 7 лет назад

    sir please provide wifidirect sender to reciver and reciver to sender program in android studio

  • @AliHasan-oz3ll
    @AliHasan-oz3ll 7 лет назад

    i want video for widget

  • @sambhusbabu
    @sambhusbabu 6 лет назад

    Can you share the source code of this app.

  • @poojapatwa217
    @poojapatwa217 7 лет назад

    hello sir,,, can u answer my question???

  • @amsyarulamin
    @amsyarulamin 7 лет назад

    Hello Sir
    Cannot resolve 'setFilter' method.. What should I do?

    • @PRABEESHRK
      @PRABEESHRK  7 лет назад +3

      Make sure that you typecast your Adapter class into Your actual Adapter class name.

    • @amsyarulamin
      @amsyarulamin 7 лет назад

      thank you Sir.. It worked. but now I have a problem parsing JSON because the file names contains invalid characters. Proven when I tried calling other files with the same PHP command but different variable and it worked.

    • @devpune6953
      @devpune6953 7 лет назад +2

      Hi What did you exactly do to resolve the setFilter method?
      Pls share the code too!

    • @shreyashmehta4261
      @shreyashmehta4261 7 лет назад

      what to do exactly? not getting it

    • @farhantanvir9624
      @farhantanvir9624 7 лет назад +1

      public RecyclerAdapter adapter;
      declare adapter class like this...this should do the magic..

  • @prashantgodhani4112
    @prashantgodhani4112 7 лет назад

    I'm use json for recycler view now i want to implement search view on that.my question is on stackoverflow link:stackoverflow.com/questions/42680559/how-to-implement-searchview

  • @hamdyabdelfattah2156
    @hamdyabdelfattah2156 5 лет назад

    awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome

  • @gurjithk1992
    @gurjithk1992 6 лет назад

    Hi sir I would like to use ur service. Plz contact me

    • @PRABEESHRK
      @PRABEESHRK  6 лет назад

      You can contact me. 91 7025239767(WhatsApp)