BaseService.java 944 Bytes
package com.qnbar.smc.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.util.Log;
import com.gimi.common.cinema.utils.ServiceCommandCollector;

/**
 * Created by wugian on 2017/5/19
 */
public class BaseService extends Service {
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        ServiceCommandCollector.addService(this, this.getClass());
        Log.d("BaseService", this.getClass().toString() + "");
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        Log.d("BaseService", this.getClass().toString() + "");
        ServiceCommandCollector.removeService(this);
        super.onDestroy();
    }
}