All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.solovyev.android.tasks.ContextCallback Maven / Gradle / Ivy

There is a newer version: 1.1.18
Show newest version
package org.solovyev.android.tasks;

import android.content.Context;

import javax.annotation.Nonnull;

/**
 * User: serso
 * Date: 4/3/13
 * Time: 10:10 PM
 */

/**
 * Callback to be used for notifying activity (or fragments or views in it) about task result.
 * After implementation of this interface see {@link Tasks#toUiThreadFutureCallback(C, ContextCallback < C ,V>)} for conversion it to
 * {@link com.google.common.util.concurrent.FutureCallback}.
 * 

* IMPLEMENTATION NOTE: please fo not implement this class as inner anonymous class of activity (fragment/view) as it will have a reference to activity (fragment/view) * which will cause memory leak. As a rule ALWAYS use it in the static context. * * @param type of context * @param type of result */ public interface ContextCallback { void onSuccess(@Nonnull C context, V result); void onFailure(@Nonnull C context, Throwable t); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy