// Path: app/src/main/java/com/lijunyan/blackmusic/service/MusicPlayerService.java
// public class MusicPlayerService extends Service {
//     private static final String TAG = MusicPlayerService.class.getName();
// 
//     public static final String PLAYER_MANAGER_ACTION = "com.lijunyan.blackmusic.service.MusicPlayerService.player.action";
// 
//     private PlayerManagerReceiver mReceiver;
// 
//     public MusicPlayerService() {
//     }
// 
//     @Override
//     public IBinder onBind(Intent intent) {
//         throw new UnsupportedOperationException("Not yet implemented");
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         Log.e(TAG, "onCreate: ");
//         register();
//     }
// 
//     @Override
//     public void onDestroy() {
//         super.onDestroy();
//         Log.e(TAG, "onDestroy: ");
//         unRegister();
//     }
// 
//     @Override
//     public int onStartCommand(Intent intent, int flags, int startId) {
//         Log.e(TAG, "onStartCommand: ");
//         return super.onStartCommand(intent, flags, startId);
//     }
// 
// 
//     private void register() {
//         mReceiver = new PlayerManagerReceiver(MusicPlayerService.this);
//         IntentFilter intentFilter = new IntentFilter();
//         intentFilter.addAction(PLAYER_MANAGER_ACTION);
//         registerReceiver(mReceiver, intentFilter);
//     }
// 
//     private void unRegister() {
//         if (mReceiver != null) {
//             unregisterReceiver(mReceiver);
//         }
//     }
// 
// }


import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatDelegate;
import com.lijunyan.blackmusic.service.MusicPlayerService;
package com.lijunyan.blackmusic.util;



/**
 * Created by lijunyan on 2017/2/8.
 */

public class MyApplication extends Application{
    private static Context context;

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
// Path: app/src/main/java/com/lijunyan/blackmusic/service/MusicPlayerService.java
// public class MusicPlayerService extends Service {
//     private static final String TAG = MusicPlayerService.class.getName();
// 
//     public static final String PLAYER_MANAGER_ACTION = "com.lijunyan.blackmusic.service.MusicPlayerService.player.action";
// 
//     private PlayerManagerReceiver mReceiver;
// 
//     public MusicPlayerService() {
//     }
// 
//     @Override
//     public IBinder onBind(Intent intent) {
//         throw new UnsupportedOperationException("Not yet implemented");
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         Log.e(TAG, "onCreate: ");
//         register();
//     }
// 
//     @Override
//     public void onDestroy() {
//         super.onDestroy();
//         Log.e(TAG, "onDestroy: ");
//         unRegister();
//     }
// 
//     @Override
//     public int onStartCommand(Intent intent, int flags, int startId) {
//         Log.e(TAG, "onStartCommand: ");
//         return super.onStartCommand(intent, flags, startId);
//     }
// 
// 
//     private void register() {
//         mReceiver = new PlayerManagerReceiver(MusicPlayerService.this);
//         IntentFilter intentFilter = new IntentFilter();
//         intentFilter.addAction(PLAYER_MANAGER_ACTION);
//         registerReceiver(mReceiver, intentFilter);
//     }
// 
//     private void unRegister() {
//         if (mReceiver != null) {
//             unregisterReceiver(mReceiver);
//         }
//     }
// 
// }


// Path: app/src/main/java/com/lijunyan/blackmusic/util/MyApplication.java
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatDelegate;
import com.lijunyan.blackmusic.service.MusicPlayerService;

package com.lijunyan.blackmusic.util;



/**
 * Created by lijunyan on 2017/2/8.
 */

public class MyApplication extends Application{
    private static Context context;

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        Intent startIntent = new Intent(MyApplication.this,MusicPlayerService.class);