Android Question Using B4A. How to I get haptic feedback when a button is pressed?

BillMeyer

Well-Known Member
Licensed User
Longtime User
This should do the trick:

B4X:
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
(Untested - Out of my head coding)

Enjoy !!
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Paulo Rosa

Member
Licensed User

Hi Erel,

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.

Regards,
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…