InputProfilFirstThreeActivity.kt
2.42 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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*/
}