Boa noite,
Estou com um problema de renderização de uma Activity do meu App:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at com.android.ninepatch.NinePatchChunk.draw(NinePatchChunk.java:190)
at com.android.ninepatch.NinePatchChunk.draw(NinePatchChunk.java:106)
at android.graphics.BaseCanvas_Delegate$1.draw(BaseCanvas_Delegate.java:464)
at com.android.layoutlib.bridge.impl.GcSnapshot.drawInLayer(GcSnapshot.java:697)
at com.android.layoutlib.bridge.impl.GcSnapshot.draw(GcSnapshot.java:587)
at android.graphics.BaseCanvas_Delegate.nDrawNinePatch(BaseCanvas_Delegate.java:461)
at android.graphics.BaseCanvas.nDrawNinePatch(BaseCanvas.java)
at android.graphics.BaseCanvas.drawPatch(BaseCanvas.java:307)
at android.graphics.Canvas.drawPatch(Canvas.java:1825)
at android.graphics.NinePatch.draw(NinePatch.java:217)
at android.graphics.drawable.NinePatchDrawable.draw(NinePatchDrawable.java:249)
at android.graphics.drawable.DrawableContainer.draw(DrawableContainer.java:87)
at android.graphics.drawable.DrawableWrapper.draw(DrawableWrapper.java:240)
at android.view.View.drawBackground(View.java:21671)
at android.view.View.draw_Original(View.java:21435)
at android.view.View_Delegate.draw(View_Delegate.java:56)
at android.view.View.draw(View.java:21417)
at android.view.View.draw_Original(View.java:21317)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:21089)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4388)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149)
at android.view.View.draw_Original(View.java:21315)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:21089)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4388)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149)
at android.view.View.draw_Original(View.java:21446)
at android.view.View_Delegate.draw(View_Delegate.java:56)
at android.view.View.draw(View.java:21417)
at com.google.android.material.textfield.TextInputLayout.draw(TextInputLayout.java:1577)
at android.view.View.draw_Original(View.java:21317)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:21089)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4388)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149)
at android.view.View.draw_Original(View.java:21315)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:21089)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4388)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149)
at android.view.View.draw_Original(View.java:21446)
at android.view.View_Delegate.draw(View_Delegate.java:56)
at android.view.View.draw(View.java:21417)
at android.widget.ScrollView.draw(ScrollView.java:1835)
at android.view.View.draw_Original(View.java:21317)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:21089)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4388)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:2023)
at android.view.View.draw_Original(View.java:21446)
at android.view.View_Delegate.draw(View_Delegate.java:56)
at android.view.View.draw(View.java:21417)
at android.view.View.draw_Original(View.java:21317)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:21089)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4388)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149)
at android.view.View.draw_Original(View.java:21315)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:21089)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4388)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149)
at android.view.View.draw_Original(View.java:21315)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:21089)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4388)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149)
at android.view.View.draw_Original(View.java:21446)
at android.view.View_Delegate.draw(View_Delegate.java:56)
at android.view.View.draw(View.java:21417)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:404)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:565)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:425)
at com.android.layoutlib.bridge.BridgeRenderSession.render(BridgeRenderSession.java:115)
at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:142)
at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:124)
at com.android.tools.idea.rendering.RenderTask.lambda$null$11(RenderTask.java:894)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Segue meu XML:
<?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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".telas.AddAgendamentoActivity">
<ScrollView
android:id="@+id/formView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/textView19"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="80dp"
android:gravity="center"
android:text="@string/hint_titulo_add_agendamento"
android:textColor="#FFFFFF"
android:textSize="30sp"
android:textStyle="bold" />
<Spinner
android:id="@+id/spCarro"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp"
android:background="@drawable/style_spinner"
android:spinnerMode="dropdown" />
<TextView
android:id="@+id/txtData"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="@string/hint_data"
android:textColor="#FFFFFF"
android:textSize="24sp" />
<Spinner
android:id="@+id/spHora"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp"
android:background="@drawable/style_spinner"
android:spinnerMode="dropdown" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp"
android:orientation="horizontal">
<Switch
android:id="@+id/switch1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:duplicateParentState="false"
android:fadeScrollbars="false"
android:focusableInTouchMode="false"
android:gravity="center"
android:textColor="#FFFFFF"
android:textOff="@string/hint_nao"
android:textOn="@string/hint_sim"
android:thumb="@drawable/thumb1"
android:textSize="18sp" />
<TextView
android:id="@+id/textView6"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="@string/hint_buscar"
android:textColor="#FFFFFF"
android:textSize="24sp" />
</LinearLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_modelo"
android:textColor="#FFFFFF"
android:textColorHighlight="#FFFFFF"
android:textColorHint="#000000"
android:textColorLink="#FFFFFF"/>
</com.google.android.material.textfield.TextInputLayout>
<Button
android:id="@+id/btnAdicionar"
style="@style/Widget.AppCompat.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="20dp"
android:background="#FFFFFF"
android:backgroundTint="#FFFFFF"
android:text="@string/hint_adicionar" />
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
Não sei do que se trata, se precisarem de mais informações, só falar!
Desde já, muito obrigado pela atenção!