Search in sources :

Example 1 with RoboInjector

use of roboguice.inject.RoboInjector in project roboguice by roboguice.

the class RoboGuice method destroyInjector.

public static void destroyInjector(Context context) {
    final RoboInjector injector = getInjector(context);
    injector.getInstance(EventManager.class).destroy();
    //noinspection SuspiciousMethodCalls
    // it's okay, Context is an Application
    injectors.remove(context);
}
Also used : ContextScopedRoboInjector(roboguice.inject.ContextScopedRoboInjector) RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager)

Example 2 with RoboInjector

use of roboguice.inject.RoboInjector in project roboguice by roboguice.

the class RoboActionBarActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    final RoboInjector injector = RoboGuice.getInjector(this);
    eventManager = injector.getInstance(EventManager.class);
    injector.injectMembersWithoutViews(this);
    super.onCreate(savedInstanceState);
    eventManager.fire(new OnCreateEvent<Activity>(this, savedInstanceState));
}
Also used : RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager) ActionBarActivity(android.support.v7.app.ActionBarActivity) Activity(android.app.Activity)

Example 3 with RoboInjector

use of roboguice.inject.RoboInjector in project roboguice by roboguice.

the class RoboActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    stopwatch = new Stopwatch();
    final RoboInjector injector = RoboGuice.getInjector(this);
    stopwatch.resetAndLog("RoboActivity creation of injector");
    eventManager = injector.getInstance(EventManager.class);
    stopwatch.resetAndLog("RoboActivity creation of eventmanager");
    injector.injectMembersWithoutViews(this);
    stopwatch.resetAndLog("RoboActivity inject members without views");
    super.onCreate(savedInstanceState);
    stopwatch.resetAndLog("RoboActivity super onCreate");
    eventManager.fire(new OnCreateEvent<Activity>(this, savedInstanceState));
    stopwatch.resetAndLog("RoboActivity fire event");
}
Also used : RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager) Stopwatch(com.google.inject.internal.util.Stopwatch) Activity(android.app.Activity)

Example 4 with RoboInjector

use of roboguice.inject.RoboInjector in project roboguice by roboguice.

the class RoboSherlockActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    final RoboInjector injector = RoboGuice.getInjector(this);
    eventManager = injector.getInstance(EventManager.class);
    injector.injectMembersWithoutViews(this);
    super.onCreate(savedInstanceState);
    eventManager.fire(new OnCreateEvent<Activity>(this, savedInstanceState));
}
Also used : RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager) SherlockActivity(com.actionbarsherlock.app.SherlockActivity) Activity(android.app.Activity)

Example 5 with RoboInjector

use of roboguice.inject.RoboInjector in project roboguice by roboguice.

the class RoboLauncherActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    final RoboInjector injector = RoboGuice.getInjector(this);
    eventManager = injector.getInstance(EventManager.class);
    injector.injectMembersWithoutViews(this);
    super.onCreate(savedInstanceState);
    eventManager.fire(new OnCreateEvent<Activity>(this, savedInstanceState));
}
Also used : RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager) LauncherActivity(android.app.LauncherActivity) Activity(android.app.Activity)

Aggregations

RoboInjector (roboguice.inject.RoboInjector)22 EventManager (roboguice.event.EventManager)21 Activity (android.app.Activity)17 OnCreateEvent (roboguice.activity.event.OnCreateEvent)3 AccountAuthenticatorActivity (android.accounts.AccountAuthenticatorActivity)2 PreferenceListener (roboguice.inject.PreferenceListener)2 ExpandableListActivity (android.app.ExpandableListActivity)1 LauncherActivity (android.app.LauncherActivity)1 ListActivity (android.app.ListActivity)1 TabActivity (android.app.TabActivity)1 PreferenceActivity (android.preference.PreferenceActivity)1 NonNull (android.support.annotation.NonNull)1 FragmentActivity (android.support.v4.app.FragmentActivity)1 ActionBarActivity (android.support.v7.app.ActionBarActivity)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 SherlockActivity (com.actionbarsherlock.app.SherlockActivity)1 SherlockFragmentActivity (com.actionbarsherlock.app.SherlockFragmentActivity)1 SherlockListActivity (com.actionbarsherlock.app.SherlockListActivity)1 SherlockPreferenceActivity (com.actionbarsherlock.app.SherlockPreferenceActivity)1 MapActivity (com.google.android.maps.MapActivity)1