android - Long click confirmation (vibration) -
in app, views react onlongclick
. in others, want achieve same functionality, want know part of view long-clicked -- i'm simulating ontouchevent
. default device behavior on long click vibration. same on simulated long click.
i know how permission vibrator , whatever want it. way? i'm looking function "default" vibrate, playsoundeffect
plays handful of default system sounds. basically, want perform default system reaction long click. may not vibration on devices...
basically, onlongclick
return true
, confirmed (vibrate). when returnning false
not vibrate.
view.setonlongclicklistener(new view.onlongclicklistener() { @override public boolean onlongclick(view view) { dosomething(); return true; } });
Comments
Post a Comment