Android Question Set Object Context

Emme Developer

Well-Known Member
Licensed User
Longtime User
Is possibile to set object context programmatically? I want to create a view in a class, and Handling the event in activity that i used to inizialize the class, without Handling the event in class and call it in activity by using call sub

Thanks!
 

Emme Developer

Well-Known Member
Licensed User
Longtime User
It is not possible. If the view is initialized in the class then the event will be raised there.
So is not possible to make a BuilderPattern of a view without using a custom event to handle his event
I mean something like this
B4X:
'Builder
Public Sub obj_Click
    CallSub2(Callback,mEventName&"_Click",Sender)
End Sub

'Main Activity
Sub btn3_Click (send As Object)
    Dim sends As Button = send
    Log(sends.Tag)
End Sub
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
So is not possible to make a BuilderPattern of a view without using a custom event to handle his event
I mean something like this
B4X:
'Builder
Public Sub obj_Click
    CallSub2(Callback,mEventName&"_Click",Sender)
End Sub

'Main Activity
Sub btn3_Click (send As Object)
    Dim sends As Button = send
    Log(sends.Tag)
End Sub
That should work I'd think
 
Upvote 0
Top