B4X:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private LastClickedTime As Long
End Sub
Public Sub Initialize
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
End Sub
Sub Button1_Click
Dim MillisecondsPassedSinceLastClick As Int = DateTime.Now - LastClickedTime
If MillisecondsPassedSinceLastClick < 2000 Then
Log("ignore")
Else
LastClickedTime = DateTime.Now
Log("Do something important that shouldn't run if less than 2 seconds passed since last click")
End If
End Sub
Quite simple but I fell for this one myself...