1

I am trying to understand how to change background image of an application (not via eclipse) using any file explorer in android(phone) and picking any file.png which will be saved as a background image in the app

noobProgrammer
  • 1,443
  • 4
  • 14
  • 33
  • Well, the only thing I can think of (if I understand this correctly, you want to change the background of an application, via another application - right?) is to set the background to Theme.Wallpaper. Then in that other application, you can set the background differently and in the base application, the BG will be changed accordingly. Try this out and tell me you're after this. – g00dy Aug 26 '13 at 13:37
  • well i dont understand what you really mean but i want to change background of my application in my application – noobProgrammer Aug 29 '13 at 10:50
  • That's what I meant. Asuming - pick the file explorer, navigate to the `.jpg`, `.png` etc. file and you set it to be your device's background. If your application uses `Theme.Wallpaper` as the default application Theme, then it will be changed, according to the background image you've set to the device. – g00dy Aug 29 '13 at 10:58
  • well i understand what you mean...and i will have a try..but i dont promise nothinggg....:D:P – noobProgrammer Aug 29 '13 at 20:36
  • :-)) Don't worry, in case of a problem - say it here :) – g00dy Aug 30 '13 at 06:05
  • Well, that doesn't help me much. What has failed, did you succeed of setting the Theme of the application to `Theme.Wallpaper`? – g00dy Sep 03 '13 at 06:48
  • yes can you use a sample code to help me understand? – noobProgrammer Oct 12 '13 at 16:53
  • Check this thread here: http://stackoverflow.com/questions/2176922/how-to-create-transparent-activity-in-android . After tyou do what was mentioned there, when you set the wallaper of your phone/device, then this will be set too in your application. – g00dy Oct 14 '13 at 06:16
  • is it possible to do it via intent? – noobProgrammer Oct 28 '13 at 18:14
  • I see absolutely no point of doing that? Why do you need an `Intent` to set the background of your application? I'm left with the impression, that you didn't understand my idea; if that's so, let me try one more time - 1. Problem - You want to change the background of your application (YApp for short), but you want to achieve this by choosing a picture from another application (let's say a Gallery). 2. Solution - the only thing I can think of is to set this desired image as a background to the device itself. Then in YApp you'll have `Theme.Wallpaper` set, which will use the device's background – g00dy Oct 29 '13 at 07:59
  • Well, did that work? Should I put this as an answer? – g00dy Nov 04 '13 at 07:01
  • yes............................. – noobProgrammer Nov 05 '13 at 15:47

1 Answers1

1

Following the comments above:

Well, the only thing I can think of (if I understand this correctly, you want to change the background of an application, via another application - right?) is to set the background to Theme.Wallpaper. Then in that other application, you can set the background differently and in the base application, the BG will be changed accordingly.

Asuming - pick the file explorer, navigate to the .jpg, .png etc. file and you set it to be your device's background. If your application uses Theme.Wallpaper as the default application Theme, then it will be changed, according to the background image you've set to the device.

In simpler terms: 1. Problem - You want to change the background of your application (YApp for short), but you want to achieve this by choosing a picture from another application (let's say a Gallery). 2. Solution - the only thing I can think of is to set this desired image as a background to the device itself. Then in YApp you'll have Theme.Wallpaper set, which will use the device's background

To put this with code, here's a sample extraction from the AndroidManifest:

<activity android:name="MainActivity" android:theme="@style/Theme.Translucent"> </activity>

This could be applied to any activity. Here's the link for reference.

Cheers

g00dy
  • 6,752
  • 2
  • 30
  • 43