endian11
2019-06-05 dd7c608db87a478e22d7138e9631e98033022e66
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.anyun.exam.lib;
 
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
 * Created by lzw on 2019/6/5. 13:22:46
 * 邮箱:632393724@qq.com
 * 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 iRemoteInterface;
    }
 
    @Override
    public void onCreate() {
        super.onCreate();
        Log.i(TAG,"onCreate()");
    }
 
    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.i(TAG,"onDestroy");
    }
}