MarkusR Well-Known Member Licensed User Longtime User Feb 13, 2018 #1 is there a Simple way to create a event in a Customview to catch this Event in the Activity Modul? something like B4X: CustomView: Sub ButtonFinish_Click RaiseEvent Ready(1) End Sub --- Activity: Sub Ready(a as int) End Sub Last edited: Feb 13, 2018
is there a Simple way to create a event in a Customview to catch this Event in the Activity Modul? something like B4X: CustomView: Sub ButtonFinish_Click RaiseEvent Ready(1) End Sub --- Activity: Sub Ready(a as int) End Sub
Erel B4X founder Staff member Licensed User Longtime User Feb 13, 2018 #2 Please use [code]code here...[/code] tags when posting code. I recommend you to use XUI for new custom views: [B4X] [XUI] Creating custom views with XUI You should use CallSubDelayed or CallSub to raise events. Example: https://www.b4x.com/android/forum/threads/b4x-xui-anotherdatepicker.85160/#content Upvote 0
Please use [code]code here...[/code] tags when posting code. I recommend you to use XUI for new custom views: [B4X] [XUI] Creating custom views with XUI You should use CallSubDelayed or CallSub to raise events. Example: https://www.b4x.com/android/forum/threads/b4x-xui-anotherdatepicker.85160/#content
MarkusR Well-Known Member Licensed User Longtime User Feb 13, 2018 #3 ahhh, that is special but it works thanks CustomView Class B4X: Sub ButtonFinish_Click CallSubDelayed2(ActivityWork,"WorkStepFinished",WorkStep1) End Sub Activity Modul B4X: Public Sub WorkStepFinished(WorkStep1 As WorkStep) Log("WorkStepFinished") End Sub Upvote 0
ahhh, that is special but it works thanks CustomView Class B4X: Sub ButtonFinish_Click CallSubDelayed2(ActivityWork,"WorkStepFinished",WorkStep1) End Sub Activity Modul B4X: Public Sub WorkStepFinished(WorkStep1 As WorkStep) Log("WorkStepFinished") End Sub
Erel B4X founder Staff member Licensed User Longtime User Feb 13, 2018 #4 Not good enough. If you are creating a custom view then you should use mCallback and mEventName to raise the events. Upvote 0
Not good enough. If you are creating a custom view then you should use mCallback and mEventName to raise the events.
MarkusR Well-Known Member Licensed User Longtime User Feb 13, 2018 #5 you mean in CallSubDelayed2 true ok i unterstand, thanks for this hint Upvote 0