Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个 android 应用程序,我想知道 android 手机是否静音。我需要知道如何通过代码在 android 模拟器上检查这个东西。
您可以根据需要使用 AudioManager 类,
AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE); if (am.getRingerMode() == AudioManager.RINGER_MODE_SILENT) { // silent mode }