2013.09.02(2)——— android 耳机意外拔出关闭声音
16lz
2021-12-04
2013.09.02(2)——— android 耳机意外拔出关闭声音
<receiver android:name=".MusicIntentReceiver"> <intent-filter> <action android:name="android.media.AUDIO_BECOMING_NOISY" /> </intent-filter></receiver>
public class MusicIntentReceiver implements android.content.BroadcastReceiver { @Override public void onReceive(Context ctx, Intent intent) { if (intent.getAction().equals( android.media.AudioManager.ACTION_AUDIO_BECOMING_NOISY)) { // signal your service to stop playback // (via an Intent, for instance) } }}
更多相关文章
- Android's 10 ms Problem? SOLVED - android 10ms 声音延迟问题
- pyaudio与优美的声音
- 痞子衡嵌入式:PCM编码与Waveform音频文件(.wav)格式详解
- 在 iMovie 中如何添加音乐和声音片段?
- 如何提取视频声音,将视频中的音乐提取出来
- macOS下使用非Apple的蓝牙耳机音质差?不妨试试这方法
- Transformer稀疏模型:将文本、图像、声音一网打尽
- 【故障】dell G7 7588笔记本已安装声卡驱动无声音
- 蚂蚁上市朋友圈都有些什么神仙声音?