On Sat, Oct 23, 2010 at 7:52 PM, Peter Webb <[email protected]> wrote:
> 1. Use SendWallPaperCommand. This works for whatever app is currently showing on top of the wallpaper. If you want to use it, make your activity's theme android:style/Theme.Wallpaper, and when you are in the foreground blast away. > This only works for the Home application. > ItMy test won't build because this is a static method and I am calling > it from an application instance. > > http://www.kiwidoc.com/java/l/x/android/android/5/p/android.view/c/IWindowSession > describes how to implement a private interface to WindowManager but > also warns "this is not part of the public API". > You don't need this, WallpaperManager already gives you the API in the public form that is supported. > 2. Use a Broadcast Receiver. This seems wrong because (1) above > implements something similar explicitly for Live Wallpapers. Nor am I > sure it will communicate with Live Wallpapers that aren't running. > Well this is up to you. If you want to interact with a specific component of yours, you can use a broadcast (or a service etc) to interact with it. If you want to interact with the current wallpaper, you can find out what component it is with getWallpaperInfo(). You could even do stuff like define a meta-data name under which your wallpaper component specifies the broadcast receiver you should send broadcasts to. If you want to do this with one of your live wallpapers even when it currently isn't selected, than of course you can't use the facilities that revolve around the current wallpaper, but can just come up with whatever approach you want (receiver, service, etc) for your two apps to interact. -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

