saving . . . saved Why var foss = intent.getStringExtra("fossID") instead of var foss = intent.getIntExtra("fossID",-1) has been deleted. Why var foss = intent.getStringExtra("fossID") instead of var foss = intent.getIntExtra("fossID",-1) has been hidden .
Why var foss = intent.getStringExtra("fossID") instead of var foss = intent.getIntExtra("fossID",-1)
Title
Question
Thanks in advance. please help me.

In Activity-1 whare we passing int values using intent to next activity but Activity-2 we are using intent.getStringExtra("fossID")
it throwing an typecasting error, to solve this i change code as below its works for me.
  
        var foss=intent.getIntExtra("RefferFossId", -1)
        var language=intent.getIntExtra("RefferLanguageId",-1)


Android-app-using-Kotlin Creating-a-Search-App 11-12 min 0-10 sec 17-05-21, 9:37 p.m. ravikr.973161@gmail.com

Answers:

var foss = intent.getStringExtra("fossID")
        var language = intent.getStringExtra("languageID")
        selectedOption.text = "Foss ID : " + foss + "\nLanguage ID : " + language

We are using to display the selected option as a string.

You may check the code that is given in the code file link below the video of this tutorial.
18-05-21, 3:26 p.m. NirmalaVenkat


Log-in to answer to this question.