soonmyeong2

intent conneted

package com.example.vip
import android.content.Intent
import android.content.Context
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.EditText
import kotlinx.android.synthetic.main.activity_input_profil_first_four.*
import kotlinx.android.synthetic.main.activity_input_profil_first_four.nextButton
import kotlinx.android.synthetic.main.activity_input_profil_first_four.previousButton
import kotlinx.android.synthetic.main.activity_input_profil_first_three.*
class InputProfilFirstFourActivity : AppCompatActivity() {
......@@ -16,9 +22,43 @@ class InputProfilFirstFourActivity : AppCompatActivity() {
startActivity(intent)
}
val prof: SharedPreferences=getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstFiveActivity::class.java)
startActivity(intent)
/*
var birthdateinput=findViewById<EditText>(R.id.editText).text.toString().toInt()
if ((2019-birthdateinput)<19){
editor.putInt("c1_2",1)
editor.commit()
//마지막장에 상관없음 추가
}
else if((2019-birthdateinput)<34){
editor.putInt("c1_3",1)
editor.commit()
}
else if((2019-birthdateinput)<40){
editor.putInt("c1_4",1)
editor.commit()
}
else if((2019-birthdateinput)<49){
editor.putInt("c1_5",1)
editor.commit()
}
else if((2019-birthdateinput)<59){
editor.putInt("c1_6",1)
editor.commit()
}
else{
editor.putInt("c1_7",1)
editor.commit()
}
*/
}
}
}
......
......@@ -8,11 +8,14 @@ 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() {
......@@ -64,10 +67,22 @@ class InputProfilFirstThreeActivity : AppCompatActivity() {
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)=="남성"){
editor.putInt("c2_1",1)
editor.commit()
//마지막장에 상관없음 추가
}
else{
editor.putInt("c2_2",1)
editor.commit()
}
}
}
......
......@@ -24,7 +24,7 @@ class InputProfilSecondThreeActivity : AppCompatActivity() {
}
nextButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondThreeActivity::class.java)
var intent = Intent(this, InputProfilThirdOneActivity::class.java)
startActivity(intent)
}
}
......