-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainActivity.kt
31 lines (25 loc) · 917 Bytes
/
MainActivity.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.example.ca2q1
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.RadioButton
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val bktkt = findViewById<RadioButton>(R.id.tktbtn)
val bkrfr = findViewById<RadioButton>(R.id.rfrbtn)
val btn = findViewById<Button>(R.id.hmbtn)
btn.setOnClickListener {
if(bktkt.isChecked){
val intent1 = Intent(this,MainActivity2::class.java)
startActivity(intent1)
}
if(bkrfr.isChecked){
val intent2 = Intent(this,MainActivity3::class.java)
startActivity(intent2)
}
}
}
}