30 lines
956 B
Kotlin
30 lines
956 B
Kotlin
package de.htwk.s3
|
|
|
|
import android.support.v7.app.AppCompatActivity
|
|
import android.os.Bundle
|
|
import kotlinx.android.synthetic.main.activity_second.*
|
|
|
|
class SecondActivity : AppCompatActivity() {
|
|
|
|
companion object {
|
|
val EDITTEXT_KEY = "edittext_key"
|
|
val CHECKBOX_KEY = "checkbox_key"
|
|
val SEEKBAR_KEY = "seekbar_key"
|
|
val PARAMETER_OBJECT_KEY = "parameter_object_key"
|
|
}
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
super.onCreate(savedInstanceState)
|
|
setContentView(R.layout.activity_second)
|
|
|
|
intent.extras?.let {
|
|
if(it.containsKey(PARAMETER_OBJECT_KEY)) {
|
|
val parameterObject: ParameterObject? = it.getParcelable(PARAMETER_OBJECT_KEY)
|
|
textView.text = parameterObject?.string
|
|
textView2.text = parameterObject?.bool.toString()
|
|
textView3.text = parameterObject?.int.toString()
|
|
}
|
|
}
|
|
}
|
|
}
|