-2

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?

Sam
  • 21
  • 2
  • 6
  • As far as I understand you need to set your app screens background. You can do this by setting the background attribute for the parent view of your activities. – Sanjeet A Jul 31 '15 at 19:13

3 Answers3

1
image extension not required....

<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=".SecondActivity">

<ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/hello"/>

 <Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="hello"
    android:layout_centerInParent="true"/>


</RelativeLayout>
Jon..
  • 430
  • 1
  • 5
  • 16
  • correct, but @zap. i have 2 apps, main app and another app is about wallpaper app, what i want is to set the image on to my main app's background from the wallpaper app... for that what should i do?? – Sam Aug 02 '15 at 08:24
1

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>
Fed X
  • 28
  • 5
  • correct, but @Fed. i have 2 apps, main app and another app is about wallpaper app, what i want is to set the image on to my main app's background from the wallpaper app... for that what should i do?? – Sam Aug 02 '15 at 08:25
0

As I have commented you need to do following - Suppose you want to Set a background of your Apps Main Screen. You can set the background of your parent view of your XML layout or you can have an ImageView as bottom layer and rest view above this using the relative layout. And now you can set the ImageView as you wish.

Sanjeet A
  • 5,171
  • 3
  • 23
  • 40
  • correct, but @Sanjeet. i have 2 apps, main app and another app is about wallpaper app, what i want is, to set the image on to my main app's background from the wallpaper app... for that what should i do?? – Sam Aug 02 '15 at 08:24