简体   繁体   English

Android onTouch 与振动类结合

[英]Android onTouch and Vibration Class Combining

First , my English is not so good.首先,我的英语不太好。 Please use a plain language if you give answers.如果您给出答案,请使用简单的语言。

I'm trying to make an app that vibrates when the user touches the screen, and stops vibrating when they remove their fingers.我正在尝试制作一个应用程序,当用户触摸屏幕时振动,当他们移开手指时停止振动。 But the vibration class takes a value in milliseconds, and I don't know at the start how long it will need to vibrate for.但是振动类以毫秒为单位取值,一开始我不知道它需要振动多长时间。 How can I make it vibrate until the user's fingers are removed?我怎样才能让它振动直到用户的手指被移开?

也许尝试一个循环调用振动 1 毫秒,直到用户抬起他们的手指。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM