0

This is how my xml layout file in IDE looks like: before

It looks like that on every device BUT Marshmallow ones, which ended up looking like this: after

As you can see, the password EditText and Remember CheckBox disappeared without a trace, yet I still can declare them in the class file normally.

This is my xml file:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_log_in"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="my.app.LogInActivity">
<!-- Dummy item to prevent AutoCompleteTextView from receiving focus -->
<LinearLayout
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:layout_width="0px"
    android:layout_height="0px"
    android:id="@+id/linearLayout5"
    android:orientation="horizontal" />

<!-- :nextFocusUp and :nextFocusLeft have been set to the id of this component
to prevent the dummy from receiving focus again -->
<AutoCompleteTextView android:id="@+id/autotext"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:nextFocusUp="@id/autotext"
    android:visibility="invisible"
    android:nextFocusLeft="@id/autotext"
    android:textSize="15sp" />

<TextView
    android:id="@+id/txtname"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/txt_customer"
    android:layout_alignBottom="@+id/txt_customer"
    android:text="Name"
    android:textSize="14sp" />

<EditText
    android:id="@+id/txt_customer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="true"
    android:layout_below="@+id/autotext"
    android:layout_toEndOf="@+id/bt_exit"
    android:ems="10"
    android:imeOptions="flagNoExtractUi"
    android:inputType="textPersonName"
    android:maxLength="100"
    android:textSize="15sp" />

<EditText
    android:id="@+id/txt_password"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/textView2"
    android:layout_alignBottom="@+id/textView2"
    android:layout_alignParentEnd="true"
    android:layout_alignStart="@+id/txt_customer"
    android:ems="10"
    android:imeOptions="flagNoExtractUi"
    android:inputType="textPassword"
    android:maxLength="100"
    android:textSize="15sp" />

<TextView
    android:id="@+id/textView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/txtname"
    android:layout_alignStart="@+id/txtname"
    android:layout_below="@+id/txt_customer"
    android:layout_marginTop="25dp"
    android:text="Pasword"
    android:textSize="14sp" />

<Button
    android:id="@+id/bt_login"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentEnd="true"
    android:text="LogIn"
    android:textColor="#000000" />

<Button
    android:id="@+id/bt_exit"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_toEndOf="@+id/linearLayout5"
    android:text="Quit"
    android:textColor="#000000" />

<CheckBox
    android:id="@+id/check_remember"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignStart="@+id/txt_password"
    android:layout_below="@+id/txt_password"
    android:text="Remember" />

<TextView
    android:id="@+id/textView3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/linearLayout5"
    android:layout_toEndOf="@+id/linearLayout5"
    android:text="Log In" />

The Name EditText and Password EditText are the same yet only the Password one disappears on Marshmallow 6.0 devices. I have already tried to change theme, Build Target, position but it's still the same. What had go wrong?

EDIT #1:This question mentioned "messy code" and it was solved by "cleaning up" the code. I am using RelativeLayout as parent like him, but changing to LinearLayout isn't viable.

EDIT #2: I tried to preset a value just to login, and it worked normally like I just typed it in manually. Inside layouts file are the same: Only one EditText appears, the rest (EditText, CheckBox, RadioButtons) disappear. What is going on?? Example: enter image description here

On Marshmallow: enter image description here

ProudNoob
  • 77
  • 2
  • 13

1 Answers1

0

Solved the disappearing bug. From this SO answer which leads me to this Google issue. I have to delete android:layout_alignBaseline attribute and they will render fine.

ProudNoob
  • 77
  • 2
  • 13