I want to simply start an activity and send some data to my second activity , this is my code :
Activiy main:
val intent = Intent(this@MainActivity, Cards::class.java)
intent.putExtra("title", catItem.name)
intent.putExtra("catId", catItem.id)
startActivity(intent)
catItem is not null and every item in it has value , i've debugged and I'm sure about it .
the second activity that I need to get data :
val bl:Bundle=intent.extras
catId=bl.getString("catId")
title=bl.getString("title")
it crashes on the second line :
bl.getString("catId") must not be null
I debugged and the bundle is completely empty .
what is wrong with this code ?