Showing
2 changed files
with
12 additions
and
44 deletions
... | @@ -35,46 +35,11 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { | ... | @@ -35,46 +35,11 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { |
35 | val prof: SharedPreferences=getSharedPreferences("profdata", Context.MODE_PRIVATE) | 35 | val prof: SharedPreferences=getSharedPreferences("profdata", Context.MODE_PRIVATE) |
36 | val editor: SharedPreferences.Editor=prof.edit() | 36 | val editor: SharedPreferences.Editor=prof.edit() |
37 | 37 | ||
38 | - manButton.setOnClickListener{ | ||
39 | - var id: Int = radio_group.checkedRadioButtonId | ||
40 | - if (id!=-1){ | ||
41 | - val radio:RadioButton = findViewById(id) | ||
42 | - editor.putString("manorwoman","man") | ||
43 | - editor.commit() | ||
44 | - /* | ||
45 | - Toast.makeText(applicationContext,"On button click : ${radio.text}"+prof.getString("manorwoman","nothing"), | ||
46 | - Toast.LENGTH_SHORT).show() | ||
47 | - */ | ||
48 | - }else | ||
49 | - { | ||
50 | - } | ||
51 | - } | ||
52 | - | ||
53 | - womanButton.setOnClickListener{ | ||
54 | - var id: Int = radio_group.checkedRadioButtonId | ||
55 | - if (id!=-1){ | ||
56 | - val radio:RadioButton = findViewById(id) | ||
57 | - Toast.makeText(applicationContext,"On button click : ${radio.text}", | ||
58 | - Toast.LENGTH_SHORT).show() | ||
59 | - editor.putString("manorwoman","woman") | ||
60 | - editor.commit() | ||
61 | - }else | ||
62 | - { | ||
63 | - } | ||
64 | - } | ||
65 | - | ||
66 | - previousButton.setOnClickListener { | ||
67 | - var intent = Intent(this, InputProfilFirstTwoActivity::class.java) | ||
68 | - startActivity(intent) | ||
69 | - } | ||
70 | - var id: Int = radio_group.checkedRadioButtonId | ||
71 | - val radio:RadioButton = findViewById(id) | ||
72 | - | ||
73 | nextButton.setOnClickListener { | 38 | nextButton.setOnClickListener { |
74 | var intent = Intent(this, InputProfilFirstFourActivity::class.java) | 39 | var intent = Intent(this, InputProfilFirstFourActivity::class.java) |
75 | startActivity(intent) | 40 | startActivity(intent) |
76 | 41 | ||
77 | - if ((radio.text)=="남성"){ | 42 | + if (manButton.isChecked){ |
78 | editor.putInt("c2_1",1) | 43 | editor.putInt("c2_1",1) |
79 | editor.commit() | 44 | editor.commit() |
80 | //마지막장에 상관없음 추가 | 45 | //마지막장에 상관없음 추가 | ... | ... |
... | @@ -23,28 +23,28 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { | ... | @@ -23,28 +23,28 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { |
23 | 23 | ||
24 | 24 | ||
25 | nextButton.setOnClickListener { | 25 | nextButton.setOnClickListener { |
26 | - var intent = Intent(this, InputProfilFirstThreeActivity::class.java) | ||
27 | - startActivity(intent) | ||
28 | 26 | ||
29 | - var birthdateinput=findViewById<EditText>(R.id.editText).text.toString().toInt() | 27 | + |
30 | - if ((2019-birthdateinput)<19){ | 28 | + var birthdateinput=findViewById<EditText>(R.id.editText).text.toString() |
29 | + var birthdateint=birthdateinput.toInt() | ||
30 | + if ((2019-birthdateint)<19){ | ||
31 | editor.putInt("c1_2",1) | 31 | editor.putInt("c1_2",1) |
32 | editor.commit() | 32 | editor.commit() |
33 | //마지막장에 상관없음 추가 | 33 | //마지막장에 상관없음 추가 |
34 | } | 34 | } |
35 | - else if((2019-birthdateinput)<34){ | 35 | + else if((2019-birthdateint)<34){ |
36 | editor.putInt("c1_3",1) | 36 | editor.putInt("c1_3",1) |
37 | editor.commit() | 37 | editor.commit() |
38 | } | 38 | } |
39 | - else if((2019-birthdateinput)<40){ | 39 | + else if((2019-birthdateint)<40){ |
40 | editor.putInt("c1_4",1) | 40 | editor.putInt("c1_4",1) |
41 | editor.commit() | 41 | editor.commit() |
42 | } | 42 | } |
43 | - else if((2019-birthdateinput)<49){ | 43 | + else if((2019-birthdateint)<49){ |
44 | editor.putInt("c1_5",1) | 44 | editor.putInt("c1_5",1) |
45 | editor.commit() | 45 | editor.commit() |
46 | } | 46 | } |
47 | - else if((2019-birthdateinput)<59){ | 47 | + else if((2019-birthdateint)<59){ |
48 | editor.putInt("c1_6",1) | 48 | editor.putInt("c1_6",1) |
49 | editor.commit() | 49 | editor.commit() |
50 | } | 50 | } |
... | @@ -52,6 +52,9 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { | ... | @@ -52,6 +52,9 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { |
52 | editor.putInt("c1_7",1) | 52 | editor.putInt("c1_7",1) |
53 | editor.commit() | 53 | editor.commit() |
54 | } | 54 | } |
55 | + var intent = Intent(this, InputProfilFirstThreeActivity::class.java) | ||
56 | + startActivity(intent) | ||
57 | + | ||
55 | } | 58 | } |
56 | 59 | ||
57 | } | 60 | } | ... | ... |
-
Please register or login to post a comment