|
@@ -3,6 +3,7 @@ package com.daya.orchestra.accompany.web;
|
|
|
import android.Manifest;
|
|
|
import android.annotation.SuppressLint;
|
|
|
import android.app.Activity;
|
|
|
+import android.bluetooth.BluetoothHeadset;
|
|
|
import android.content.Intent;
|
|
|
import android.content.IntentFilter;
|
|
|
import android.content.pm.ActivityInfo;
|
|
@@ -342,8 +343,11 @@ public class AccompanyActivity extends BaseActivity<ActivityAccompanyBinding> {
|
|
|
}
|
|
|
|
|
|
private void registerBroadCast() {
|
|
|
+ IntentFilter intentFilter = new IntentFilter();
|
|
|
+ intentFilter.addAction(Intent.ACTION_HEADSET_PLUG);
|
|
|
+ intentFilter.addAction(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED);
|
|
|
mReceiver = new PlayMusicReceiver();
|
|
|
- registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
|
|
|
+ registerReceiver(mReceiver, intentFilter);
|
|
|
}
|
|
|
|
|
|
private void addToken(String url) {
|