com.nikedlab.android.inject.InjectedActivity Maven / Gradle / Ivy
package com.nikedlab.android.inject;
import android.app.Activity;
import android.os.Bundle;
public abstract class InjectedActivity extends Activity {
private InjectedApplication application;
@Override
protected void onCreate(Bundle savedInstanceState) {
if ("Dalvik".equals(System.getProperty("java.vm.name"))) {
InjectedApplication application = getInjectedApplication();
application.injectInto(this);
}
super.onCreate(savedInstanceState);
}
private InjectedApplication getInjectedApplication() {
if (application == null) {
application = (InjectedApplication) getApplication();
}
return application;
}
}