Parcourir la source

处理云教练的耳机监听broadcast,不需要service

Pq il y a 9 mois
Parent
commit
35d2e615c2

+ 2 - 0
BaseLibrary/src/main/java/com/cooleshow/base/service/PlayMusicReceiver.java

@@ -5,6 +5,7 @@ import android.content.Context;
 import android.content.Intent;
 
 import com.cooleshow.base.constanst.Constants;
+import com.cooleshow.base.utils.LOG;
 
 
 public class PlayMusicReceiver extends BroadcastReceiver {
@@ -14,6 +15,7 @@ public class PlayMusicReceiver extends BroadcastReceiver {
         if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
             if (intent.hasExtra("state")) {
                 int state = intent.getIntExtra("state", 0);
+                LOG.i("onReceive state "+state);
                 if (state == 0) {
                     //无耳机插入
                     Constants.HEADSET_PLUE_TAG = "";