JLChen
2021-03-16 3617e6eecac94965554487afc50d39b0584324fb
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
package android.serialport.api.sample;
 
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
 
public class MyService extends Service {
 
    @Override
    public void onCreate() {
        super.onCreate();
 
        new Thread() {
 
            @Override
            public void run() {
                ReceiveAndSend.Start();
                super.run();
            }
 
        }.start();
    }
 
    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        return super.onStartCommand(intent, flags, startId);
    }
 
    @Override
    public void onDestroy() {
        super.onDestroy();
    }
 
    @Override
    public IBinder onBind(Intent intent) {
        // TODO Auto-generated method stub
        return null;
    }
 
}