Good morning, my friend Erel, thanks to your code, I was able to set the phone's wallpaper, but now how can I use it so that the background change is applied with a button? Because it is created so that when opening the application, it changes the background automatically. Could you help me? Here is the code provided by you:
Post the (relevant) code that you are running and the error message. Right click to copy the logs.
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
SetWallPaper(LoadBitmap(File.DirAssets, "p.jpg"))
End Sub
Sub Activity_Pause(UserClosed As Boolean)
End Sub
Sub Activity_Resume
End Sub
Sub SetWallPaper(Bmp As Bitmap)
Dim r As Reflector
r.Target = r.RunStaticMethod("android.app.WallpaperManager", "getInstance", _
Array As Object(r.GetContext), Array As String("android.content.Context"))
r.RunMethod4("setBitmap", Array As Object(Bmp), Array As String("android.graphics.Bitmap"))
End Sub
Private Sub Button1_Click
End Sub