Hello dear friends ?
I want to change the background activity
How can I select and set photo from the phone gallery by pressing Button4?
I want to change the background activity
How can I select and set photo from the phone gallery by pressing Button4?
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private Button1 As Button
Private Button2 As Button
Private Button3 As Button
Private Button4 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Activity.SetBackgroundImage(LoadBitmap(File.DirAssets, "background1.jpg"))
End Sub
Private Sub Button3_Click
Activity.SetBackgroundImage(LoadBitmap(File.DirAssets, "background3.png"))
End Sub
Private Sub Button2_Click
Activity.SetBackgroundImage(LoadBitmap(File.DirAssets, "background2.png"))
End Sub
Private Sub Button4_Click
End Sub