작성
·
139
0
package com.bokchi.mysolelife.auth
import android.database.DatabaseUtils
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import androidx.databinding.DataBindingUtil
import com.bokchi.mysolelife.R
import com.bokchi.mysolelife.databinding.ActivityIntroBinding
import com.google.firebase.Firebase
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.auth
class JoinActivity : AppCompatActivity() {
private lateinit var binding: ActivityIntroBinding
private lateinit var auth: FirebaseAuth
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
auth = Firebase.auth
binding = DataBindingUtil.setContentView(this, R.layout.activity_join)
binding.joinBtn.setOnClickListener {
val email = binding.emailArea
}
// auth.createUserWithEmailAndPassword("abc@abc.com", "12341234")
// .addOnCompleteListener(this) { task ->
// if (task.isSuccessful) {
// Toast.makeText(this, "성공", Toast.LENGTH_LONG).show()
// } else {
// Toast.makeText(this, "실패", Toast.LENGTH_LONG).show()
// }
// }
}
}
여기 보면 선생님과 똑같이 했는데 emailArea을 이제 칠때 빨간색으로 뜨면서 안되요...
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".auth.JoinActivity"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:background="@color/mainColor"
android:layout_height="150dp">
<TextView
android:text="회원가입"
android:gravity="center"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="50dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:orientation="vertical">
<EditText
android:id="@+id/emailArea"
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="email"
style="@style/AuthEditText"/>
<LinearLayout
android:layout_width="match_parent"
android:background="#999999"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="0.5dp"/>
<EditText
android:id="@+id/passwordArea"
android:layout_width="match_parent"
android:layout_height="50dp"
android:inputType="textPassword"
android:hint="password"
style="@style/AuthEditText"/>
<LinearLayout
android:layout_width="match_parent"
android:background="#999999"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="0.5dp"/>
<EditText
android:id="@+id/passwordArea2"
android:layout_width="match_parent"
android:layout_height="50dp"
android:inputType="textPassword"
android:hint="password check"
style="@style/AuthEditText"/>
<LinearLayout
android:layout_width="match_parent"
android:background="#999999"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="0.5dp"/>
<Button
android:id="@+id/joinBtn"
android:layout_margin="20dp"
android:background="@drawable/background_radius_yellow"
android:text="회원가입하기"
android:layout_width="match_parent"
android:layout_height="50dp"/>
</LinearLayout>
</LinearLayout>
</layout>
여기 ID emailArea 적어져 있습니다 그런데 왜(?) 이런 오류가 뜨는 것일가요?? 알려주세요...ㅠㅠ
해결 했습니다!!!
잘못된 클래스를 사용해버려서 안되었습니다..ㅎㅎ 아주 쉽고 간단한 문제를 하루 반이나 사용을 했네요 다음 강의 부터는 눈에 불을 키고 따라하도록 하겠습니다!! 좋은 강의 해주셔서 감사합니다~~!