------------------------------------------------------------------------------------
MainActivity.kt
-------------------------------------------------------------------------------------
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
var BTN_load_calendar: Button = findViewById(R.id.btn_load_calendar)
var BTN_load_timer: Button = findViewById(R.id.btn_load_timer)
var TEXT_selected_date: TextView = findViewById(R.id.text_selected_date)
var TEXT_selected_time: TextView = findViewById(R.id.text_selected_time)
val cal = Calendar.getInstance()
// 달력 로드
BTN_load_calendar.setOnClickListener {
DatePickerDialog(this, DatePickerDialog.OnDateSetListener { datePicker, y, m, d ->
TEXT_selected_date.text = "$y/${m+1}/$d"
}, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH)).show()
}