강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

이하진님의 프로필 이미지
이하진

작성한 질문수

[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)

Firebase 회원가입 구현

회원가입 구현시 emailArea붉은색

작성

·

281

1

안녕하세요.

 

Firebase회원가입 구현 강의의 8:00 따라 하고 있습니다.

 

activity_join.xml에서 아이디 다 추가주었는데 이렇게 뜨네요

 

Unresolved reference: passwordArea2

 

private lateinit var auth: FirebaseAuth

    private lateinit var binding: ActivityIntroBinding

    override fun onCreate(savedInstanceState: Bundle?) {

        super.onCreate(savedInstanceState)

        auth = Firebase.auth

        //setContentView(R.layout.activity_join)

        binding = DataBindingUtil.setContentView(this, R.layout.activity_join)

        binding.joinBtn.setOnClickListener {
            val email = binding.emailArea.text.toString()
            val password1 = binding.passwordArea1.text.toString()
            val password2 = binding.passwordArea2.text.toString()

            // 저기 값이 비어있는지 확인
            if (email.isEmpty()){
                Toast.makeText(this, "이메일을 입력해주세요", Toast.LENGTH_LONG).show()
            }
            if(password1.isEmpty()){
                Toast.makeText(this, "password1을 입력해주세요", Toast.LENGTH_LONG).show()
            }
            if(password2.isEmpty()){
                Toast.makeText(this, "password2을 입력해주세요", Toast.LENGTH_LONG).show()
            }
            if (!password1.equals(password2)){
                Toast.makeText(this, "비밀번호을 똑같이 입력해주세요", Toast.LENGTH_LONG).show()
            }
        }
    }

답변 3

1

이하진님의 프로필 이미지
이하진
질문자

private lateinit var binding: ActivityIntroBinding

으로 입력했었네요. Join으로 고쳐서 해결했습니다!

 

 

 

0

이하진님의 프로필 이미지
이하진
질문자

<?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:layout_height="150dp"
            android:background="@color/maincolor">
    
            <TextView
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:gravity="center"
                android:text="회원가입"
                android:textColor="#000000"
                android:textSize="20sp"
                android:textStyle="bold" />
        </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:hint="email"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                style="@style/AuthEditText"/>
            <!--아래 선 만들기-->
            <LinearLayout
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_width="match_parent"
                android:layout_height="0.5dp"
                android:background="#999999" />
    
            <!--password 입력받기 -->
            <EditText
                android:id="@+id/passwordArea1"
                android:hint="password"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:inputType="textPassword"
                style="@style/AuthEditText"/>
            <!--아래 선 만들기-->
            <LinearLayout
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_width="match_parent"
                android:layout_height="0.5dp"
                android:background="#999999" />
    
            <!--password check -->
            <EditText
                android:id="@+id/passwordArea2"
                android:hint="password check"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:inputType="textPassword"
                style="@style/AuthEditText"/>
            <!--아래 선 만들기-->
            <LinearLayout
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_width="match_parent"
                android:layout_height="0.5dp"
                android:background="#999999" />
    
            <Button
                android:id="@+id/joinBtn"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:layout_margin="20dp"
                android:text="회원가입하기"
                android:background="@drawable/background_yellow"
                />
    
        </LinearLayout>
    
    </LinearLayout>
</layout>

0

개복치개발자님의 프로필 이미지
개복치개발자
지식공유자

안녕하세요 하진님

activity_join.xml 의 전체 코드도 공유해주시겠어요?

이하진님의 프로필 이미지
이하진

작성한 질문수

질문하기