I have create an android app with Kotlin.This app contains an interface, which contains a recyclerview to get all the list of product.
To fill this list of product, i create an adapter, this adapter is a cardview : Imageview and two textview.
In this interface, i added two buttons, one when i click on all the product display with the list and the other one display with grid disposition.The default value for grid disposition.
I wsant to change the width and the height of a cardview, to display all the product in the List.
The following code is anadapter item:
the following code is an extract from an xml file which cotains a recyclerview :
the following code contains the onclick acion into the two buttom(Imageview) :
after running my app an exception appear as the following :
could you please tell me where's the error and how can i correct it