Search in sources :

Example 1 with ReceiveExternalFilesActivity

use of com.owncloud.android.ui.activity.ReceiveExternalFilesActivity in project android by owncloud.

the class TaskRetainerFragment method setTask.

/**
     * Sets the task to retain across configuration changes
     *
     * @param task  Task to retain
     */
public void setTask(CopyAndUploadContentUrisTask task) {
    if (mTask != null) {
        mTask.setListener(null);
    }
    mTask = task;
    Context context = getContext();
    if (mTask != null && context != null) {
        if (context instanceof ReceiveExternalFilesActivity) {
            task.setListener((CopyAndUploadContentUrisTask.OnCopyTmpFilesTaskListener) context);
        } else {
            task.setListener(null);
        }
    }
}
Also used : Context(android.content.Context) CopyAndUploadContentUrisTask(com.owncloud.android.ui.asynctasks.CopyAndUploadContentUrisTask) ReceiveExternalFilesActivity(com.owncloud.android.ui.activity.ReceiveExternalFilesActivity)

Aggregations

Context (android.content.Context)1 ReceiveExternalFilesActivity (com.owncloud.android.ui.activity.ReceiveExternalFilesActivity)1 CopyAndUploadContentUrisTask (com.owncloud.android.ui.asynctasks.CopyAndUploadContentUrisTask)1