InputProfilFourthTwoActivity.kt
1.92 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
}
}
}