简体   繁体   中英

Vibrator In Android, Stopping when the app exits

I am basically developing an Applicatin which requires the App to Vibrate just before it closes down.

Now when I call the vibrator.vibrate() function and then call the finish() function, the Vibration is stopped and the app is exited, before the Vibration completes.

I want the app to wait until the vibration gets over and then exit!

Thanks in Advance!

I think you need set a duration for vibration for this purpose given links can help you Can you increase vibrator strength on android devices? . http://techblogon.com/vibrate-android-phone-programmatically/

After setting duration you need set a timer before exiting that equals to the vibration milliseconds :) so your application will exit after vibration period completed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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