-1

I'm trying to make a Recyclerview, where i can display cards. I've followed this tutorial, wich displays exactly what I want. However this is not what's showing in my application right now.

I've tried to debug the Adapter to see if the data is Empty, but that's not the case

The classes i'm using

The activity_main i'm using

The card_view i'm using

The cardView also uses a gradient and layout for the button from the Drawable package, but those are probably not relevant.

On startup, the recyclerview is not being showed on my activity.

I expect the layout like the tutorial displays in the beginning of the video.

  • 1
    no project in github – Basi Mar 29 '19 at 08:51
  • 1
    your link is broken – Nikos Hidalgo Mar 29 '19 at 08:51
  • 2
    The link doesn't work, and in any case, you should post code here that identifies the problem and not link to it elsewhere. – PPartisan Mar 29 '19 at 08:52
  • Check your model class size and did you define model size in Recycler Adapter getItemCount() method – Vasudev Vyas Mar 29 '19 at 08:52
  • I'll show my classes then. Sorry for this – Schredder Beeren Mar 29 '19 at 08:53
  • I've updated the link. The code should be seen in Hastebin right now – Schredder Beeren Mar 29 '19 at 09:09
  • @SchredderBeeren haven't you read the above comment? we won't follow these links. maybe read [asking](https://stackoverflow.com/help/asking) first, because this explains how to ask in detail. you'll have this question put on hold, unless providing the least code to reproduce the problem. – Martin Zeitler Mar 29 '19 at 09:12
  • Well, @VasudeVyas already answered my question. My getItemCount() return 0 instead of the list.size(). The problem I feel with asking a question about this is that I use 4 xml stylesheets and 3 classes, so I couldn't specify the problem myself. – Schredder Beeren Mar 29 '19 at 09:25
  • 1
    DO NOT add code off-site. Not as screenshots, not on pastebin, not on GitHub, not on . Paste it into the question, and create a [mcve] – Zoe Mar 29 '19 at 09:35

1 Answers1

0

Put size of your mData list in getItemCount():

@Override
public int getItemCount() {
    return mData.size();
}
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
niceumang
  • 1,347
  • 1
  • 8
  • 21