У меня есть категория класса, и я перехожу на дополнительную, категория нажата.
это работало на 6 экранах, но на последнем я получаю ноль
занятие, в которое я положил дополнительные
adapter.setOnItemClickListener { item, view ->
val categories = item as Categories
val intent = Intent(view.context, LearningFirstLibras::class.java)
intent.putExtra(CATEGORY_KEY, categories.category)
startActivity(intent)
}
категория
@Parcelize
class Category(
val name: String,
val imageURL: String,
val real_name: String,
val object_1_screen_libras_image: String,
val object_1_screen_libras_text: String,
val object_2_screen_libras_text: String,
val object_2_screen_libras_image: String,
val object_3_screen_libras_text: String,
val object_3_screen_libras_image: String,
val object_1_screen_asl_text: String,
val object_1_screen_asl_image: String,
val object_2_screen_asl_text: String,
val object_2_screen_asl_image: String,
val object_3_screen_asl_text: String,
val object_3_screen_asl_image: String,
val question: String,
val answer: String,
val alternative_1: String,
val alternative_2: String,
val alternative_3: String,
val alternative_4: String
) : Parcelable {
constructor() : this("", "", "", "", "",
"","","","",
"","","","",
"","","","","","",
"","")
}
активность, где я получил ноль
class Quiz : AppCompatActivity() {
var categoryF:Category = Category()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_quiz)
categoryF = intent.getParcelableExtra(NewWordsActivity.CATEGORY_KEY)