Code example for HandlerThread

Methods: quit

0
        return new PicasaSyncAdapter(getApplicationContext()).getSyncAdapterBinder();
    } 
 
    @Override 
    public void onDestroy() { 
        mSyncThread.quit();
    } 
 
    public static boolean performSync(Context context, Account account, Bundle extras, SyncResult syncResult) {
        // Skip if another sync is pending. 
        if (!sSyncPending.compareAndSet(false, true)) {
            return false; 
        } 
 
        // Perform the sync. 
        performSyncImpl(context, account, extras, syncResult);
 
        // Mark sync as complete and notify all waiters. 
        sSyncPending.set(false);
        synchronized (sSyncPending) {
            sSyncPending.notifyAll();