I have a activity xml file, when i run it i get 2 errors. activity_forget_and_change_password.xml:2: AAPT: error: unbound prefix. activity_forget_and_change_password.xml: AAPT: error: file failed to compile.
Hope someone can help me. I have search internet and i cant find the right answer to my problem.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical"
android:padding="16dp"
tools:context="xxxxxxxxx.ForgetAndChangePasswordActivity">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="FireBase Change Password"
android:gravity="center"
android:textAllCaps="true"
android:textSize="16sp"
android:padding="10dp"/>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/label">
<EditText
android:id="@+id/mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Mode"
android:inputType="textEmailAddress"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/colorPrimary" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/submit_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dip"
android:background="@color/colorPrimary"
android:text="Submit"
android:textColor="@color/white" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical"
android:padding="16dp"
tools:context="xxxxxxx.ForgetAndChangePasswordActivity">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="FireBase Change Password"
android:gravity="center"
android:textAllCaps="true"
android:textSize="16sp"
android:padding="10dp"/>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/label">
<EditText
android:id="@+id/mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Mode"
android:inputType="textEmailAddress"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/colorPrimary" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/submit_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dip"
android:background="@color/colorPrimary"
android:text="Submit"
android:textColor="@color/white" />
</LinearLayout>
Change your TextInputLayout to androidx component:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/label">
And add support libraries to your app build.gradle:
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.