InputProfilFourthTwoActivity.kt 1.92 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.view.View.GONE
import android.view.View.VISIBLE
import kotlinx.android.synthetic.main.activity_input_profil_fourth_two.*

class InputProfilFourthTwoActivity : AppCompatActivity() {

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

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

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

        nextButton.setOnClickListener {
            if(yesButton.isChecked){editor.putInt("c15_2",1); editor.commit()}
            if(noButton.isChecked){editor.putInt("c15_3",1); editor.commit()}
            if(jeonsaeButton.isChecked){editor.putInt("c16_2",1); editor.commit()}
            if(wolseButton.isChecked){editor.putInt("c16_3",1); editor.commit()}
            if(kongkongButton.isChecked){editor.putInt("c16_4",1); editor.commit()}
            if(moosangButton.isChecked){editor.putInt("c16_5",1); editor.commit()}
            if(bojangButton.isChecked){editor.putInt("c16_6",1); editor.commit()}
            if(guitarButton.isChecked){editor.putInt("c16_7",1); editor.commit()}

            var intent = Intent(this, InputProfilFourthThreeActivity::class.java)
            startActivity(intent)
        }

        yesButton.setOnClickListener {
            subLayout.visibility=GONE
            noButton.isChecked=false
        }
        noButton.setOnClickListener {
            subLayout.visibility=VISIBLE
            yesButton.isChecked=false
        }

    }
}