本文整理汇总了Java中org.greenrobot.eventbus.EventBusException类的典型用法代码示例。如果您正苦于以下问题:Java EventBusException类的具体用法?Java EventBusException怎么用?Java EventBusException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventBusException类属于org.greenrobot.eventbus包,在下文中一共展示了EventBusException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: register
import org.greenrobot.eventbus.EventBusException; //导入依赖的package包/类
public void register(final Object object) {
final Class clazz = object.getClass();
final String clazzName = clazz.getName();
if (getClasses().containsKey(clazzName)) {
System.out.println("Class already registered on eventbus: " + clazzName);
} else {
System.out.println("Registering Class on eventbus: " + clazz.getName());
try {
eventBus.register(object);
} catch (final EventBusException e) {
}
getClasses().put(clazzName, clazz);
}
}
示例2: createSubscriberMethod
import org.greenrobot.eventbus.EventBusException; //导入依赖的package包/类
protected SubscriberMethod createSubscriberMethod(String methodName, Class<?> eventType, ThreadMode threadMode,
int priority, boolean sticky) {
try {
Method method = subscriberClass.getDeclaredMethod(methodName, eventType);
return new SubscriberMethod(method, eventType, threadMode, priority, sticky);
} catch (NoSuchMethodException e) {
throw new EventBusException("Could not find subscriber method in " + subscriberClass +
". Maybe a missing ProGuard rule?", e);
}
}
示例3: register
import org.greenrobot.eventbus.EventBusException; //导入依赖的package包/类
public static void register(EventBus bus, Object listener) {
try {
bus.register(listener);
} catch (EventBusException e) {
LogHelper.w(TAG, e);
}
}
示例4: unregister
import org.greenrobot.eventbus.EventBusException; //导入依赖的package包/类
public static void unregister(EventBus bus, Object listener) {
try {
bus.unregister(listener);
} catch (EventBusException e) {
LogHelper.w(TAG, e);
}
}