Android Studio Tutorial – Recycler View with Multiple view types edmt dev


Link donate :
Facebook :
Source code :

While I was doing my real projects, I encountered a difficult problem, namely displaying multiple view types on the same recycler view. And after the research I have found the solution, I would like to share this solution with you all

edmt dev,android программирование,android studio,android studio tutorial,recyclerview,андроид программирование,android recyclerview tutorial,android studio recyclerview tutorial,android studio tutorial – recycler view with multiple view types,android программирование opengl,edmt dev recycler view,how to create recyclerview with multiple view type?,how to upload image in firebase database,multiple recyclerview,multiple recyclerview android,multiple type recyclerview Link donate:



  1. Great work! But I was wondering if you can show how I can also add an image into it.

    I found the answer to my question. kinda created one but here it is:

    #First, you should have an image view in your items XML.

    #In the items class:
    private int imageUrl;
    this.imageUrl = imageUrl;
    public int getImageUrl() {

    return imageUrl;


    public void setImageUrl(int imageUrl) {

    this.imageUrl = imageUrl;


    #In the main activity class:
    private int[] images = {R.drawable.your_resours…..};
    Weapons item = new Weapons("this is item", "this is child",images[0],true);


    #In the Recycler Adapter class:
    add the image view declarations then,
    viewHolder.image.setImageResource (items.get(position).getImageUrl());

  2. Good Work
    Sir, I fetch data from sqlite Database.
    Let me example: Item code is A1190001 now I get all data related to item code in one ViewType ReceylerView and next view next item code……….
    Plz Help

  3. i have question i have test to make recycler view for delivery order but how to make it display in recycler view in random order like i have 2 card delivery and pickup i want it to display depend on the order so when u have 2 pickup it will show 2 pickup only or 2 pickup and 1 delivery depend on the order we get.

  4. I got an error in,


    public int getItemViewType(int position) {
    return 1;
    return 0;

    the error dialog :
    cannot resolve method 'isExpandable()'

    How can to fix this ?

    thank you very much..

  5. Hello Sir,,

    thanks for ur tutorial,

    how can I use custom list data in expandable ? its just show data with item data 1 item data 2 and next with formula,.

    I want to insert custom image and text in expandable

  6. hi notifydatasetchanged doesn't works inside custom adapter here's my code
    final ProductAdapter temp=this;

    holder.addquantitynobutton.setOnValueChangeListener(new ElegantNumberButton.OnValueChangeListener() {


    public void onValueChange(ElegantNumberButton view, int oldValue, int newValue) {



    new Database(context).removefromcart(product.getKey());

    if(new Database(context).getcartitem()==0){if(snackbar!=null &&snackbar.isShown()){snackbar.dismiss();}}



  7. hello sir kindly help me to do this with volley i really like your work n i want to fetch the json data in recylcerview with multiple view types plz help

  8. I tried to follow your steps twice but the application did not work with me. Can you attach the source code to the project?

  9. Hello sir, first thanks for this tutorial. I using this listview and ı create my custom adapter. I want image and textview to be in expanded layout. I wrote code but layout not expanding, image and text showing on top of parent layout. How can ı fix this.

  10. What about this? It dosent have any property boolean like isexpanded true false

  11. Hey! this example looks perfect.. Can you help if me with my task… I have to do same example with JSON… #Help is appreciated…

  12. sir i have two different arrays from where i am setting my data on the adapter…

    but when i get data from 2nd array the 1st array's data got lost and it sets from the direct 3rd position of array

    how can i solve this when i am having two different array's data ??

  13. Good morning, your videos are great, congratulations.
    I would like to know how to use the data of a SQLite in this method that you implemented in this video?

    I already have all the code of registration and the search.
    I just can not put the data registered in this expandable recyclerView.

    follow the search code:

     public ArrayList <Client> findCustomers () {

            ArrayList <Client> clients = new ArrayList <> ();
            StringBuilder sql = new StringBuilder ();
            sql.append ("SELECT _id, name, cpf, birth, telephone, email, street, neighborhood, number, complement, city, state");
            sql.append ("FROM producer");
            Result Cursor = connection.rawQuery (sql.toString (), null);
            if (result.getCount ()> 0) {
                resultado.moveToFirst ();

                    Client cli = new Client ();
           = result.getInt (result.getColumnIndexOrThrow ("_ id"));
           = result.getString (result.getColumnIndexOrThrow ("name"));
                    cli.cpf = result.getString (result.getColumnIndexOrThrow ("cpf"));
                    cli.nascimento = resultado.getString (result.getColumnIndexOrThrow ("birth"));
                    cli.telephone = result.getString (result.getColumnIndexOrThrow ("phone"));
           = result.getString (result.getColumnIndexOrThrow ("email"));
                    cli.rua = result.getString (result.getColumnIndexOrThrow ("street"));
                    cli.bairro = resultado.getString (result.getColumnIndexOrThrow ("neighborhood"));
                    cli.numero = resultado.getString (result.getColumnIndexOrThrow ("number"));
                    cli.complemento = resultado.getString (resultado.getColumnIndexOrThrow ("complement"));
           = result.getString (result.getColumnIndexOrThrow ("city"));
                    cli.status = result.getString (result.getColumnIndexOrThrow ("status"));

                    customers.add (cli);

                } while (result.moveToNext ());
            return customers;

  14. Hello sir… i am a regular user of your channel and learnt lot of things from your projects. Kindly sir make a video on "How to make sections or groups in recycler view based on key of multivalued hashmap (each key holds linklist having more than one value) like the one done in "duplicate file fixer" app available on google play store… Efforts will be appreciated… Thanx in advance sir.. 🙂

  15. sir .. I have fix error , but have Logical Error ,
    when add new element to rectclerView to section 1 ,
    result is add this element with new section 1
    Like I have in rectclerView two section 1 , I need add all element under section 1

    Like this image :

    I want my recycler to be more dynamic with firebase ..
    can add new item food with header to be organized

    Give me hints for doing that 😀 ,,
    Thank you very much In advance ..

  16. sir .. I try add alot subText in list not one , when I try get Erros .
    can you give me hint to do that ?

    this my Error when try to do that in class MyAdapter ..
    java.lang.IndexOutOfBoundsException: Invalid index 3, size is 3

    this line : viewHolder.textViewChild.setText(items.get(position).getSubText().get(position));

    Thanks in advance ..

  17. Your videos help us a lot sir. 😀 In the future, will you be able to store data of google maps in firebase and show it in a textview??? Thanks for your time :)))

  18. Sir, can you make a shopping list app, which takes name of that shopping list from user (maybe through alert dialog), save it in recycler view and onClick of list item we can add items that we want to buy.

  19. amazing work sir is it possible for you that after completing fire store work you start Node js for android because node js is so fast and firebase every things is good but firebase database is not good for use little bit big project

  20. hi sir pls learn creat advenced tv online and perfect chat app and perfect music app online with fire base tanks for your best your tutorials

  21. Hello sir can u plz make tutorial on google spread sheet api for updating and delete from Android app ? thanx for reading my comment?


Please enter your comment!
Please enter your name here