InputProfilFirstThreeActivity.kt 2.42 KB
package com.example.vip

import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.util.MonthDisplayHelper
import android.view.View
import android.widget.EditText
import android.widget.RadioButton
import android.widget.RadioGroup
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_input_profil_first_one.*
import kotlinx.android.synthetic.main.activity_input_profil_first_three.*
import kotlinx.android.synthetic.main.activity_input_profil_first_three.nextButton
import kotlinx.android.synthetic.main.activity_input_profil_first_two.*

class InputProfilFirstThreeActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_input_profil_first_three)

        /* not use this code start
        radio_group.setOnCheckedChangeListener(
            RadioGroup.OnCheckedChangeListener { group, checkedId ->
                val radio: RadioButton = findViewById(checkedId)
                Toast.makeText(applicationContext," On checked change : ${radio.text}",
                    Toast.LENGTH_SHORT).show()
            })
         not use this code end */

        previousButton.setOnClickListener {
            var intent = Intent(this, InputProfilFirstTwoActivity::class.java)
            startActivity(intent)
        }

        val prof: SharedPreferences=getSharedPreferences("profdata", Context.MODE_PRIVATE)
        val editor: SharedPreferences.Editor=prof.edit()

        nextButton.setOnClickListener {
            var intent = Intent(this, InputProfilFirstFourActivity::class.java)
            startActivity(intent)

            if (manButton.isChecked){
                editor.putInt("c3_2",1)
                editor.commit()
                //마지막장에 상관없음 추가
            }
            else{
                editor.putInt("c3_3",1)
                editor.commit()
            }
        }
    }

/* i will not use this code start
    fun radio_button_click(view: View){
        // Get the clicked radio button instance
        val radio: RadioButton = findViewById(radio_group.checkedRadioButtonId)
        Toast.makeText(applicationContext,"On click : ${radio.text}",
            Toast.LENGTH_SHORT).show()
    }
i will not use this code start end*/


}