Can anyone see why the "LargeImage" Click event is not being called in this code?
This code is in Activity2 and is called from activity Main with the code
I have tried a small test program using CAllSubDelayed and the scrollview2d. That worked for click and long click. I am stumped!
Thanks
Mark
B4X:
Sub Process_Globals
Private mBmp As Bitmap
End Sub
Sub Globals
Dim sv2d As ScrollView2D
Dim Webview1 As WebView
Dim width, height As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.AddMenuItem("Fill Screen", "FitToScreen")
Activity.AddMenuItem("Go back", "GoBack")
End Sub
Sub Activity_Resume
Activity.Invalidate
End Sub
Sub ShowMainUrl(URL As String)
Webview1.Initialize("")
Webview1.LoadUrl(URL)
Activity.AddView(Webview1, 0, 0, 100%x, 100%y)
End Sub
Sub ShowImage(bmp As Bitmap)
mBmp = bmp
sv2d.Initialize(mBmp.width, mBmp.height, "LargeImage")
sv2d.Panel.SetBackgroundImage(mBmp)
Activity.AddView(sv2d, 0, 0, 100%x, 100%y)
End Sub
Sub LargeImage_Click
Activity.OpenMenu
End Sub
Sub GoBack_Click
If Webview1.IsInitialized Then Webview1.RemoveView
If sv2d.IsInitialized Then sv2d.RemoveView
File.Delete(File.DirRootExternal & "/goddess/", Main.ImageFileName)
Activity.Finish
End Sub
'Trap the back button
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
Activity.OpenMenu
Return True
Else
Return False
End If
End Sub
This code is in Activity2 and is called from activity Main with the code
B4X:
CallSubDelayed2(Activity2, "ShowImage", bd)
I have tried a small test program using CAllSubDelayed and the scrollview2d. That worked for click and long click. I am stumped!
Thanks
Mark