Proyectos de Subversion Android Microlearning

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
package com.cesams.twogetskills.sync;
2
 
3
import android.app.Service;
4
import android.content.Intent;
5
import android.os.IBinder;
6
 
7
public class SyncService extends Service {
8
 
9
    private static SyncAdapter syncAdapter = null;
10
    private static final Object lock = new Object();
11
 
12
    @Override
13
    public void onCreate() {
14
        synchronized (lock) {
15
            if (syncAdapter == null) {
16
                syncAdapter = new SyncAdapter(getApplicationContext(), true);
17
            }
18
        }
19
    }
20
 
21
    @Override
22
    public IBinder onBind(Intent intent) {
23
        return syncAdapter.getSyncAdapterBinder();
24
 
25
    }
26
}