Android - How to show Google password saver after login

Viewed 28

I have a simple login with username/mail and password.

I have another app that it works perfectly and i dont have anything in the code that forces it to show. It seems native.

After i achieve a successfull login i want that my phone shows the Google Password manager natively. Idk if "google password manager" is the correct name because when i google it i find other stuffs. I will attach the photos.

Login from another app that i have

Box that i want to show

here is my XML of the project that i want to achieve this

        <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/login_user_id"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:hint="Email"
        android:outlineProvider="none"
        app:boxStrokeColor="#37bbed"
        app:hintTextColor="#37bbed"
        app:layout_constraintEnd_toStartOf="@+id/guideline9"
        app:layout_constraintStart_toStartOf="@+id/guideline7"
        app:layout_constraintTop_toBottomOf="@+id/subtitulo_login">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/login_user_idEText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textEmailAddress"
            android:textCursorDrawable="@drawable/color_cursor" />

    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/login_user_password"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:hint="Clave"
        app:boxStrokeColor="@color/colorPrimaryMiB"
        app:endIconMode="password_toggle"
        app:hintTextColor="@color/colorPrimaryMiB"
        app:layout_constraintEnd_toStartOf="@+id/guideline9"
        app:layout_constraintStart_toStartOf="@+id/guideline7"
        app:layout_constraintTop_toBottomOf="@+id/login_user_id">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/login_user_passwordEText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textPassword"
            android:textCursorDrawable="@drawable/color_cursor" />

    </com.google.android.material.textfield.TextInputLayout>

Thanks!

1 Answers

I just needed to call finish() on the activity after the startActivity().

Related