How can intent or pass data through on click image in (slider Layout) android

后端 未结 1 347
萌比男神i
萌比男神i 2020-12-22 03:04

I am a new application developer I try intent or pass data through on click image in (slider Layout) from first activity to the second activity. I try to intent (name) to s

1条回答
  •  抹茶落季
    2020-12-22 03:18

    Use this code for sending data from FirstActivity:

     val intent = Intent(this@FirstActivity, SecondActivity::class.java)
                intent.putExtra("imagename", imageid)
                startActivity(intent)
    

    And this for delivering date in SecondActivity:

    var imageid = intent.getStringExtra("imagename")
    

    0 讨论(0)
提交回复
热议问题