Back to project page RecipeBook.
The source code is released under:
Copyright (c) 2013, Ian Lake All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Red...
If you think the Android project RecipeBook listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ianhanniballake.recipebook.sync; //from w w w .j av a2 s . c o m import android.app.Service; import android.content.Intent; import android.os.IBinder; /** * Service to handle sync with Drive. It instantiates the SyncAdapter and returns its IBinder. */ public class SyncService extends Service { private static SyncAdapter sSyncAdapter = null; private static final Object sSyncAdapterLock = new Object(); @Override public IBinder onBind(final Intent intent) { return sSyncAdapter.getSyncAdapterBinder(); } @Override public void onCreate() { synchronized (sSyncAdapterLock) { if (sSyncAdapter == null) sSyncAdapter = new SyncAdapter(getApplicationContext(), true); } } }