신기성

first third problem resolve

......@@ -35,46 +35,11 @@ class InputProfilFirstThreeActivity : AppCompatActivity() {
val prof: SharedPreferences=getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
manButton.setOnClickListener{
var id: Int = radio_group.checkedRadioButtonId
if (id!=-1){
val radio:RadioButton = findViewById(id)
editor.putString("manorwoman","man")
editor.commit()
/*
Toast.makeText(applicationContext,"On button click : ${radio.text}"+prof.getString("manorwoman","nothing"),
Toast.LENGTH_SHORT).show()
*/
}else
{
}
}
womanButton.setOnClickListener{
var id: Int = radio_group.checkedRadioButtonId
if (id!=-1){
val radio:RadioButton = findViewById(id)
Toast.makeText(applicationContext,"On button click : ${radio.text}",
Toast.LENGTH_SHORT).show()
editor.putString("manorwoman","woman")
editor.commit()
}else
{
}
}
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstTwoActivity::class.java)
startActivity(intent)
}
var id: Int = radio_group.checkedRadioButtonId
val radio:RadioButton = findViewById(id)
nextButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstFourActivity::class.java)
startActivity(intent)
if ((radio.text)=="남성"){
if (manButton.isChecked){
editor.putInt("c2_1",1)
editor.commit()
//마지막장에 상관없음 추가
......
......@@ -23,28 +23,28 @@ class InputProfilFirstTwoActivity : AppCompatActivity() {
nextButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstThreeActivity::class.java)
startActivity(intent)
var birthdateinput=findViewById<EditText>(R.id.editText).text.toString().toInt()
if ((2019-birthdateinput)<19){
var birthdateinput=findViewById<EditText>(R.id.editText).text.toString()
var birthdateint=birthdateinput.toInt()
if ((2019-birthdateint)<19){
editor.putInt("c1_2",1)
editor.commit()
//마지막장에 상관없음 추가
}
else if((2019-birthdateinput)<34){
else if((2019-birthdateint)<34){
editor.putInt("c1_3",1)
editor.commit()
}
else if((2019-birthdateinput)<40){
else if((2019-birthdateint)<40){
editor.putInt("c1_4",1)
editor.commit()
}
else if((2019-birthdateinput)<49){
else if((2019-birthdateint)<49){
editor.putInt("c1_5",1)
editor.commit()
}
else if((2019-birthdateinput)<59){
else if((2019-birthdateint)<59){
editor.putInt("c1_6",1)
editor.commit()
}
......@@ -52,6 +52,9 @@ class InputProfilFirstTwoActivity : AppCompatActivity() {
editor.putInt("c1_7",1)
editor.commit()
}
var intent = Intent(this, InputProfilFirstThreeActivity::class.java)
startActivity(intent)
}
}
......