• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

java.lang.IllegalStateException: cardProductItem must not be null

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!