如果发现音箱在使用?音箱、发现

由网友(会深拥请别离开)分享简介:在Android上,是有可能在任何时候找到,如果扬声器正在使用中,如果是哪个应用在使用它。In Android , is it possible at any given time to find if speaker is in use and if so which app is using it.对不起,我不...

在Android上,是有可能在任何时候找到,如果扬声器正在使用中,如果是哪个应用在使用它。

In Android , is it possible at any given time to find if speaker is in use and if so which app is using it.

对不起,我不知道如何表达出该问题。我想要做的是找出是否有任何应用程序(音乐播放器)播放音乐文件或者使用扩音器或耳手机。此外,如果有可能找到它的应用程序在使用它。

Sorry i did not know how to phrase the question. What i want to do is find out if any app (Music Player) is playing a music file either using the loud speaker or the ear phones. Also if possible find which app is using it.

对不起,不知道该怎么短语这一点。

Sorry Don't know how else to phrase this.

推荐答案

我需要这找到,如果音乐正在播放设备。我发现功能AudioManager下 isMusicActive()。它返回true,只有当音乐确实正在播放,其假evnen当玩家在前景和暂停。它为我工作至今。

I needed this to find if music is currently playing on the device. I found the function isMusicActive() under AudioManager. It returns true only when music is actually playing, its false evnen when player is in foreground and paused. Its worked for me so far.

阅读全文

相关推荐

最新文章