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

com.nikedlab.android.inject.InjectedListFragment Maven / Gradle / Ivy

There is a newer version: 3.0.13
Show newest version
package com.nikedlab.android.inject;

import android.app.Activity;
import android.support.v4.app.ListFragment;

/**
 * Created with Comodo Inc.
 * User: Kuzmenko Victor
 * Date: 2/6/14
 * Time: 6:03 PM
 */
public class InjectedListFragment extends ListFragment {

    /**
     * InjectedApplication object
     */
    private InjectedApplication application;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        InjectedApplication application = getInjectedApplication(activity);
        application.injectInto(this);
    }

    /**
     * @return {@link InjectedApplication}
     */
    private InjectedApplication getInjectedApplication(Activity activity) {
        if (application == null) {
            application = (InjectedApplication) activity.getApplication();
        }
        return application;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy