Search code examples
androidwallpapersetting

Set Wallpaper on application background


I am making an application, in which i want to set wallpaper on application background, not on the homescreen background. Can anyone there guide me how to do this?


Solution

  • Note that BackGround or the Image view should always on top of other view

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:src="@drawable/bu"/>
    
    <TextView android:text="@string/hello_world"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="40dp"
        android:textSize="45sp"/>
    <TextView android:text="Good_Day"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:padding="40dp"
        android:textSize="45sp"/>
    
    </RelativeLayout>