You should use ConstraintLayout or RelativeLayout. In those the views can be placed atop each other.
Try this:
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:id="@+id/activity_java_surface_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
android:id="@+id/text_overlay"
android:layout_width="0dp"
android:layout_height="60dp"
android:text="test text"
android:background="#00000000"
app:layout_constraintBottom_toBottomOf="@id/activity_java_surface_view"
app:layout_constraintEnd_toEndOf="@id/activity_java_surface_view"
app:layout_constraintStart_toStartOf="@id/activity_java_surface_view"
/>