Several options, the first one would be defining as background an image through the property android:background
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/mi_fondo">
</RelativeLayout>
The second, using a ImageView
with properties, android:layout_width="match_parent"
and android:layout_height="match_parent"
, defining an image with property android:background
:
<ImageView
android:id="@+id/myImageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/mi_fondo"/>
the third one using an ImageView, using the property android:scaleType="fitXY"
:
<ImageView
android:id="@+id/Load_img_splash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@null"
android:scaleType="fitXY"
android:src="@drawable/mi_imagen" />
and the fourth, defining a theme, where you define the image:
<style name="miFondo" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowBackground">@drawable/mi_fondo</item>
<item name="android:windowNoTitle">true</item>
</style>
and you load it from your activity, defining the theme in AndroidManifest.xml
<activity android:name=".MainActivity"
android:theme="@style/miFondo"></activity>