本文介绍了如何关闭使用Android API的所有声音和振动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我建立一个Android应用程序,和我想要的应用程序启动时禁用所有的声音和设备的振动。
I'm building an android app, and i'm trying to disable all sounds and vibration of the device when the app starts.
我是新手,我无法找到如何做到这一点。
I'm newbie and I cannot find how to do that.
任何想法?
由于提前,
推荐答案
谢谢! :)我回答自己完成了答案:
Thanks! :) I reply myself to complete the answer:
AudioManager aManager=(AudioManager)getSystemService(AUDIO_SERVICE);
aManager.setRingerMode(aManager.RINGER_MODE_SILENT);
这篇关于如何关闭使用Android API的所有声音和振动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!