Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = KeyCodes.KEYCODE_VOLUME_DOWN Then
'Your code here
Return True
Else If KeyCode = KeyCodes.KEYCODE_VOLUME_UP Then
'Your code here
Return True
End If
End Sub