本文整理汇总了Java中roboguice.event.EventManager类的典型用法代码示例。如果您正苦于以下问题:Java EventManager类的具体用法?Java EventManager怎么用?Java EventManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventManager类属于roboguice.event包,在下文中一共展示了EventManager类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import roboguice.event.EventManager; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
// We want to skip the real functionality of Activity (even though it's
// shadowed and just test the firing of events)
Robolectric.bindShadowClass(ShadowActivity.class);
// Our mock event manager - we'll check on it for fired events
mockEventManager = mock(EventManager.class);
// initialize RoboGuice
RoboGuice.setBaseApplicationInjector(Robolectric.application,
Stage.DEVELOPMENT,
RoboGuice.newDefaultRoboModule(Robolectric.application),
new TestModule(mockEventManager));
// Our activity under test
activity = activityClass.newInstance();
// We need to initialize it
call("onCreate", Bundle.class, null);
}
示例2: onCreate
import roboguice.event.EventManager; //导入依赖的package包/类
@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));
}
示例3: onCreate
import roboguice.event.EventManager; //导入依赖的package包/类
@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));
}
示例4: onCreate
import roboguice.event.EventManager; //导入依赖的package包/类
@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(savedInstanceState));
}
示例5: onCreate
import roboguice.event.EventManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
final RoboInjector injector = RoboGuice.getInjector(this);
eventManager = injector.getInstance(EventManager.class);
preferenceListener = injector.getInstance(PreferenceListener.class);
injector.injectMembersWithoutViews(this);
super.onCreate(savedInstanceState);
eventManager.fire(new OnCreateEvent(savedInstanceState));
}
示例6: onCreate
import roboguice.event.EventManager; //导入依赖的package包/类
@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( savedInstanceState ) );
}
示例7: obtainInjector
import roboguice.event.EventManager; //导入依赖的package包/类
public HoloInjector obtainInjector() {
if (mInjector != null) {
return mInjector;
}
WeakReference<HoloInjector> reference = sInjectorsMap.get(get());
mInjector = reference == null ? null : reference.get();
if (mInjector == null) {
mInjector = createInjector(get());
sInjectorsMap.put(get(), reference);
}
mEventManager = mInjector.getInstance(EventManager.class);
return mInjector;
}
示例8: TestModule
import roboguice.event.EventManager; //导入依赖的package包/类
public TestModule(EventManager eventManager) {
this.eventManager = eventManager;
}
示例9: configure
import roboguice.event.EventManager; //导入依赖的package包/类
@Override
protected void configure() {
bind(EventManager.class).toInstance(eventManager);
}
示例10: getEventManager
import roboguice.event.EventManager; //导入依赖的package包/类
public EventManager getEventManager() {
return mEventManager;
}