I am trying to store the String from the Hours and Number for use in a new activity. I have found ways of doing it with intent
but do not want the strings sent through to the next activity. Is there any way of me saving my String data and being able to call it to a different activity?
class ChecksStartUp : AppCompatActivity() {
lateinit var hours: EditText
lateinit var number: EditText
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
getSupportActionBar()?.hide()
setContentView(R.layout.activity_Checks_pg1)
val number = findViewById(R.id.machineFleetNumberId)
val hours = findViewById(R.id.machineHoursId)
val dButton = findViewById<RadioButton>(R.id.dButtonId)
val eButton = findViewById<RadioButton>(R.id.eButtonId)
val hButton = findViewById<RadioButton>(R.id.hButtonId)
val proceedButton = findViewById<Button>(R.id.proceedButtonId)
proceedButton.setOnClickListener {
if (dButton.isChecked()) {
val intent = Intent(this, DPage::class.java)
startActivity(intent)
}
if (eButton.isChecked()) {
val intent = Intent(this, EPage::class.java)
startActivity(intent)
}
if (hButton.isChecked()) {
val intent = Intent(this, HPage::class.java)
}
}
}
}