I made a little app with a map for learning. Over the map I added a textView with actual position upgrading.. After some problems I did it with a such layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:orientation="vertical">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapsActivity" />
<TextView
android:id="@+id/txt_location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="TextView"
android:textSize="30sp"
android:textAlignment="center"
android:textColor="@drawable/common_google_signin_btn_icon_light"/>
<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/txt_location"
android:layout_centerHorizontal="true"
app:srcCompat="@drawable/ic_action_name" />
</RelativeLayout>
Now I would add an imageView for showing gps status (focused, enabled, disabled). I added the imageView under the textView, but I don't see anything. After some try I'm asking why.
ps: If I put imageVIew in a LinearLayout (before the map) I see linearLaout (in black for es.) over the map, and I still can't see image but, eventually, only the background if setted. It's not my goal to add a linear layout, but also in this way I can't see image.
I created image by -> new image asset -> launcher icon (legacy only) clip-art (android logo) -> mo effects. than I added it by reference in the imageView.
Solved!
I don't know if it's usual, but adding ImageView from design window, it code Imageview as I posted. Searching around I found similar situations and I found that correct way to show image over MapFragment is make a change to default code of ImageVIew:
from:
app:srcCompat="@drawable/img_name" />
to
android:src="@drawable/img_name" />
I don't know if I do something wrong with inserting new ImageView, but hope this could help people that do as me.