package com.cooleshow.base.service;

import android.app.Service;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;

public class PlayMusicService extends Service {
    private final PlayMusicReceiver receiver = new PlayMusicReceiver();
    private static final String TAG = "PlayMusicService";
    @Override
    public IBinder onBind(Intent intent)
    {
        return null;
    }

    @Override
    public void onCreate()
    {
//        registerReceiver(mReceiver, intentFilter);//注册广播
        registerReceiver(receiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
        super.onCreate();

    }

    @Override
    public void onDestroy()
    {

        unregisterReceiver(receiver);
        super.onDestroy();
//        Log.i(TAG, "Destroy Service");
    }


}
