Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim vib As PhoneVibrate
Dim but1 As button
End Sub
Sub but1_Click
vib.vibrate
'do here what you need to with this button
End Sub
Private Sub PerformHapticFeedback (view As Object)
#if B4A
Dim jo As JavaObject = view
jo.RunMethod("performHapticFeedback", Array(1))
#Else if B4i
FeedbackGenerator.RunMethod("impactOccurred", Null) 'see the tetris example
#end if
End Sub
Private Sub PerformHapticFeedback (view As Object)
#if B4A
Dim jo As JavaObject = view
jo.RunMethod("performHapticFeedback", Array(1))
#Else if B4i
FeedbackGenerator.RunMethod("impactOccurred", Null) 'see the tetris example
#end if
End Sub
How can I use this code if the view is a widget image, for instance? I mean, I would like to perform haptic feedback when an image of a widget is pressed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.