RecyclerView & CardView not working properly in 2020? — Android App

Daryll Wong
4 min readNov 23, 2019

How to use RecyclerView & CardView

If you have looked through many tutorials implementing RecyclerView & CardView, and you are still thinking why your Android Application is still facing many problems that you dont know how to solve, then this post is for you!

First of all…

Does any of these seem familiar to you?

  1. When you are trying to create your CardView…. but you cant see its design properly….
This is what your Cardview looks like…this is wrong

Though in tutorials it looks nice like this

This is what you should see

2. When you are adding RecyclerView into your page layout but… it also looks similarly flawed… (one big dark grey background)

This is wrong too!

But this is what you see in tutorials & what you should expect to see!

The RecyclerView is displayed as Item0 to Item 9 by default, if it works correctly.

3. If you ignore the above, all the code does not have any pre-run errors and app seems to build fine. But when you run the app and go to the page that has the RecyclerView and CardView, your app crashes…

App crashing!

Also with tons of red errors in Logcat that you dont understand.

THEN this post is for you!

Because I have faced the same problems and can’t find any prevalent good answers on google/stackoverflow etc.

What happened?

It is all because of dependency and android version problems.

If you are viewing this in 2019 or 2020, then yes, you are probably already using the updated version of android (AndroidX or ‘Jetpack’) and the seemingly latest versions of RecyclerView and…

--

--