Vibrator In Android, Stopping when the app exits

余生长醉 提交于 2019-12-11 23:56:14

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/22320398/vibrator-in-android-stopping-when-the-app-exits

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!