treehousefrog Member Licensed User Longtime User Jun 10, 2013 #1 Hey guys, This has come up a number of times it seems, but I don't think there's been a resolution yet. I'm creating a homescreen launcher and I want to be able to set live wallpapers as the background. This thread explains how to set static bitmaps that are the phone background: http://www.b4x.com/forum/basic4andr...-activity-background-current-wallpaper-2.html Code looks like so: Dim r As Reflector Dim backg As Bitmap Dim d As BitmapDrawable backg.InitializeMutable(Activity.Width,Activity.Height) d.Initialize(backg) r.Target = r.RunStaticMethod("android.app.WallpaperManager", "getInstance", Array As Object(r.GetContext), Array As String("android.content.Context")) Activity.Background = r.RunMethod("peekDrawable") And from my explorations I think we need a surface view to host the live wallpaper? If anyone can point me in the right direction I'd be hugely grateful - it's been one of those long days of surfing the web to no avail... Thanks!
Hey guys, This has come up a number of times it seems, but I don't think there's been a resolution yet. I'm creating a homescreen launcher and I want to be able to set live wallpapers as the background. This thread explains how to set static bitmaps that are the phone background: http://www.b4x.com/forum/basic4andr...-activity-background-current-wallpaper-2.html Code looks like so: Dim r As Reflector Dim backg As Bitmap Dim d As BitmapDrawable backg.InitializeMutable(Activity.Width,Activity.Height) d.Initialize(backg) r.Target = r.RunStaticMethod("android.app.WallpaperManager", "getInstance", Array As Object(r.GetContext), Array As String("android.content.Context")) Activity.Background = r.RunMethod("peekDrawable") And from my explorations I think we need a surface view to host the live wallpaper? If anyone can point me in the right direction I'd be hugely grateful - it's been one of those long days of surfing the web to no avail... Thanks!
Erel B4X founder Staff member Licensed User Longtime User Jun 11, 2013 #2 You can add this line to the manifest editor: Code: SetActivityAttribute(main, android:theme, @android:style/Theme.Wallpaper) This will cause the wallpaper to appear as the activity background. I think that this is the best you can do to show a live wallpaper in your activity. Upvote 0
You can add this line to the manifest editor: Code: SetActivityAttribute(main, android:theme, @android:style/Theme.Wallpaper) This will cause the wallpaper to appear as the activity background. I think that this is the best you can do to show a live wallpaper in your activity.
NeoTechni Well-Known Member Licensed User Longtime User Aug 11, 2013 #3 That works really well. Even responds to touch. Is there any way to take control over the horizontal scrolling though? Upvote 0
That works really well. Even responds to touch. Is there any way to take control over the horizontal scrolling though?