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

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

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

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * Created with Comodo Inc.
 * User: Kuzmenko Victor
 * Date: 8/7/13
 * Time: 1:38 PM
 */
public abstract class BroadcastReceiverInjector extends BroadcastReceiver {

    private InjectedApplication application;

    @Override
    public void onReceive(Context context, Intent intent) {
        if ("Dalvik".equals(System.getProperty("java.vm.name"))) {
            InjectedApplication application = getInjectedApplication();
            application.injectInto(this);
        }

    }

    private InjectedApplication getInjectedApplication() {
        if (application == null) {
            application = (InjectedApplication) InjectedApplication.application;
        }
        return application;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy