Consume, Return, Void questions
Return is actually the Back key. This is how you trap the Back key
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode=KeyCodes.KEYCODE_BACK Then
'Give statements to execute when Back key is pressed
Return True
End If
End Sub
Hi one follow up. What does consume the event actually mean? I've seen this in several postings. I'm just reading through the threads to get an idea what is possible and what is not as well as learn how to use B4A and find this confusing perhaps because I'm not a programmer.
Does it mean I just exit the event and go back to where it was called from and since I'm returning true it appears that the event completed? Or am I not understanding this correctly.
I see that the following in the help:
KEYWORDS
Return
Method
Returns from the current sub and optionally returns the given value.
Syntax: Return [value]
Returns : Void
Unfortunately I don't really understand what that means.
I have also seen Void all over the place but not been able to get a clear understanding of what that means.
thanks
Libor