Android Question Error "current module does not support layout events" but manually writing _click works !

AnandGupta

Expert
Licensed User
Longtime User
I was looking for resizable widget logic. Forum search gave me excellent sample, thanks to @Sagenut

In the given sample code, the 4x1 widget service code has 'label1_click' event.
I wanted to add 'label2_click' from the layout designer but got error message,
B4X:
current module does not support layout events

B4A_ehRmC5lIgb.png

Since 'label1_click' already exists in the code, I copy-pasted it as 'label2_click' and both works.

B4X:
Sub Label1_Click
    rv.UpdateWidget
End Sub

Sub Label2_Click
    rv.SetText("Label2", DateTime.Time(DateTime.Now))
    Sleep(100)
    rv.UpdateWidget
End Sub

Now my query is if by manually writing the click event we can achieve what is required, why the designer is giving error message ?
 

AnandGupta

Expert
Licensed User
Longtime User
This is a very special case, only relevant to home screen widgets.
Ok.
But new members / users may not know that they can write the event code manually.
I understand it is not possible for designer to guess so, but some hints here may help, or link to B4X webpage explaining it.
 
Upvote 0
Top