endian11
2019-06-05 dd7c608db87a478e22d7138e9631e98033022e66
lib/src/main/java/com/anyun/exam/lib/RemoteService.java
@@ -3,7 +3,10 @@
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.support.annotation.Nullable;
import android.util.Log;
/**
 * MyApplication2
@@ -12,9 +15,43 @@
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
public class RemoteService extends Service {
    private static final String TAG = "RemoteService";
    private RemoteCallbackList<IListenerInterface> mListenerList = new RemoteCallbackList();
    private IRemoteInterface.Stub iRemoteInterface = new IRemoteInterface.Stub(){
        @Override
        public void registListener(IListenerInterface i) throws RemoteException {
            //注册回调方法
            mListenerList.register(i);
        }
        @Override
        public void unRegistListener(IListenerInterface i) throws RemoteException {
            mListenerList.unregister(i);
        }
        @Override
        public void add() throws RemoteException {
        }
    };
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
        return iRemoteInterface;
    }
    @Override
    public void onCreate() {
        super.onCreate();
        Log.i(TAG,"onCreate()");
    }
    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.i(TAG,"onDestroy");
    }
}