I'm quite new in app designing, so this may be solved somewhere else. But I have been unable to find the answer.
I have an app with 3 activities. 2 of them work with no problem. The 3th one has worked till now, but when I have tried to modify it I have discovered 3 things:
- No blueprints are shown at Android Studio design view: no blueprints
- Changes don't seem to refresh in the design view
- Unless I erase something needed (like a button), changes have no impact in the final result
I have tried googling around finding a solution. Also tried erasing different parts of the XML file to see if I have some problem with the coding. Nothing worked. No blueprints, no changes in the preview in Android Studio, and no changes in the emulator unless I erase something needed (in that case I got a compilation error and the app didn't work at all, which is logical).
The other activities work normal, so I am prone to think that there might be a coding problem in the XML file? But I have been unable to find it. If I don't touch it, the app works fine.
Here you have the code for the XML file:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:panel="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".Test"
tools:showIn="@layout/activity_test"
tools:visibility="visible">
<RelativeLayout
android:id="@+id/MainLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0">
<LinearLayout
android:id="@+id/Lay_Top"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="5dp"
android:minHeight="30dp"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="@+id/Lay_Constraint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/Sub_Temas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:gravity="top"
android:text="@string/action_Temas_Test"
android:textColor="@color/colorPrimary"
android:textStyle="bold" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:gravity="center_horizontal|center_vertical"
android:textStyle="bold" />
<Switch
android:id="@+id/Mostrar_R"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:maxWidth="100dp"
android:text="@string/action_Mostrar" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Lay_Constraint"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/Botones_debajo"
android:layout_below="@+id/Lay_Top"
android:layout_marginTop="0dp"
android:layout_marginBottom="10dp"
app:layout_constraintTop_toBottomOf="@+id/Lay_Top">
<ScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintHorizontal_weight=".90">
<LinearLayout
android:id="@+id/Lay_Preguntas"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight=".90"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/Pregunta"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/action_Pregunta"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/Lay_Respuestas"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/Lay_R_a"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<CheckBox
android:id="@+id/R_a"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:text="a)" />
<Button
android:id="@+id/Respuesta_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:gravity="start"
android:paddingTop="10dp"
android:paddingBottom="5dp"
android:text="@string/Respuesta_a"
android:textAllCaps="false" />
</LinearLayout>
<LinearLayout
android:id="@+id/Lay_R_b"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<CheckBox
android:id="@+id/R_b"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:text="b)" />
<Button
android:id="@+id/Respuesta_b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:gravity="start"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="@string/Respuesta_b"
android:textAllCaps="false" />
</LinearLayout>
<LinearLayout
android:id="@+id/Lay_R_c"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="visible">
<CheckBox
android:id="@+id/R_c"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:text="c)" />
<Button
android:id="@+id/Respuesta_c"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:background="@android:color/transparent"
android:gravity="start"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="@string/Respuesta_c"
android:textAllCaps="false" />
</LinearLayout>
<LinearLayout
android:id="@+id/Lay_R_d"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<CheckBox
android:id="@+id/R_d"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:text="d)" />
<Button
android:id="@+id/Respuesta_d"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:gravity="start"
android:paddingTop="5dp"
android:paddingBottom="10dp"
android:text="@string/Respuesta_d"
android:textAllCaps="false"
app:layout_constraintLeft_toRightOf="@+id/R_d" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/Botones_debajo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@+id/Lay_Constraint"
tools:layout_editor_absoluteX="7dp"
tools:layout_editor_absoluteY="498dp">
<LinearLayout
android:id="@+id/Botones_abajo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@+id/Lay_Preguntas"
tools:layout_editor_absoluteX="7dp"
tools:layout_editor_absoluteY="498dp">
<Button
android:id="@+id/Anterior"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/mybutton"
android:text="@string/Anterior"
android:textColor="#FFFFFF"
android:textStyle="bold" />
<Button
android:id="@+id/FIN"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_weight="1"
android:background="@drawable/mybutton2"
android:text="@string/FIN"
android:textColor="#FFFFFF"
android:textStyle="bold" />
<Button
android:id="@+id/Siguiente"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/mybutton"
android:text="@string/Siguiente"
android:textColor="#FFFFFF"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/Ultimo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="5dp"
app:layout_constraintTop_toBottomOf="@+id/Botones_abajo"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="563dp">
<TextView
android:id="@+id/N_Hechas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:text="@string/N_Hechas"
android:textSize="14sp" />
<TextView
android:id="@+id/textView16"
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="/" />
<TextView
android:id="@+id/N_Total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left|center_vertical"
android:text="@string/N_Total" />
</LinearLayout>
<LinearLayout
android:id="@+id/banner_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
app:adSize="SMART_BANNER"
app:adUnitId="ca-app-pub-4714690554501841/7558886048"
tools:ignore="MissingConstraints" />
</LinearLayout>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<!--Your commentapp:adUnitId="ca-app-pub-4714690554501841/7558886048"-->