当前位置: 首页>>代码示例>>Java>>正文


Java ThreadEnforcer.MAIN属性代码示例

本文整理汇总了Java中com.squareup.otto.ThreadEnforcer.MAIN属性的典型用法代码示例。如果您正苦于以下问题:Java ThreadEnforcer.MAIN属性的具体用法?Java ThreadEnforcer.MAIN怎么用?Java ThreadEnforcer.MAIN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.squareup.otto.ThreadEnforcer的用法示例。


在下文中一共展示了ThreadEnforcer.MAIN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

@Override public void onCreate() {
    super.onCreate();

    // create an event bus to allow our gcm intent service to notify when new messages are available
    EVENT_BUS = new Bus(ThreadEnforcer.MAIN);

    // create instances - typically these would be created as part of a dependency injection framework to allow for mocking, different environments, etc.
    SharedPreferences gcmSharedPrefs = getSharedPreferences(GCM_SHARED_PREFS_NAME, Context.MODE_PRIVATE);
    PUSH_REGISTRATION_SERVICE = new RestAdapter.Builder()
            .setEndpoint(BuildConfig.PUSH_SERVER_ENDPOINT)
            .setLogLevel(RestAdapter.LogLevel.FULL)
            .build()
            .create(ExamplePushRegistrationService.class);
    PUSH_MANAGER = new ExamplePushManager(InstanceID.getInstance(this), GCM_SENDER_ID, gcmSharedPrefs, PUSH_REGISTRATION_SERVICE);

    // this will register the device with GCM and retrieve a registration id for this device
    PUSH_MANAGER.registerWithGCM();
}
 
开发者ID:shiftconnects,项目名称:android-push-manager,代码行数:18,代码来源:ExampleApplication.java

示例2: getEventBus

/**
 * Lazy loading event bus.
 *
 * @return Event bus service.
 */
public Bus getEventBus() {
    if (eventBus == null) {
        eventBus = new Bus(ThreadEnforcer.MAIN, LOG_TAG);
    }
    return eventBus;
}
 
开发者ID:filipebezerra,项目名称:HorariosRmtcGoiania,代码行数:11,代码来源:EventBusProvider.java

示例3: initialize

public static void initialize() {
    mBus = new Bus(ThreadEnforcer.MAIN);
    mHandler = new Handler();

    // Activity and fragment lifecycle events make it difficult to reliably
    // make register and unregister calls in a 1-to-1 way. So we're going
    // to make sure that things only get registered once and unregistered if
    // they're actually registered.
    mRegisteredObjects = new HashSet<Object>();
}
 
开发者ID:Psiphon-Labs,项目名称:ploggy,代码行数:10,代码来源:Events.java

示例4: MainThreadBus

public MainThreadBus() {
    super(ThreadEnforcer.MAIN);
}
 
开发者ID:SysdataSpA,项目名称:UniversalEventBus,代码行数:3,代码来源:MainThreadBus.java

示例5: BusModule

public BusModule() {
    bus = new Bus(ThreadEnforcer.MAIN);
}
 
开发者ID:erlymon,项目名称:erlymon-monitor-android,代码行数:3,代码来源:BusModule.java

示例6: provideBus

@Provides @Singleton
public Bus provideBus() {
    return new Bus(ThreadEnforcer.MAIN);
}
 
开发者ID:jetpeter,项目名称:imgur-auto-uploader,代码行数:4,代码来源:UtilsModule.java

示例7: PostFromAnyThreadBus

public PostFromAnyThreadBus()
{
    super(ThreadEnforcer.MAIN);
}
 
开发者ID:pagesjaunes,项目名称:androidMobileDeviceManager,代码行数:4,代码来源:PostFromAnyThreadBus.java

示例8: EventBusProvider

private EventBusProvider() {
    mBus = new Bus(ThreadEnforcer.MAIN);
}
 
开发者ID:dhis2,项目名称:dhis2-android-dashboard,代码行数:3,代码来源:EventBusProvider.java

示例9: DataBus

public DataBus() {
    super(ThreadEnforcer.MAIN);
}
 
开发者ID:armueller,项目名称:FluxyAndroidTodo,代码行数:3,代码来源:DataBus.java

示例10: provideBus

@Singleton @Provides Bus provideBus() {
    return new Bus(ThreadEnforcer.MAIN, "Fonz Bus");
}
 
开发者ID:decarbonization,项目名称:android-fonz,代码行数:3,代码来源:GamePlayModule.java

示例11: provideBus

@Singleton
@Provides
protected Bus provideBus() {
    return new Bus(ThreadEnforcer.MAIN);
}
 
开发者ID:avast,项目名称:android-lectures,代码行数:5,代码来源:AppModule.java

示例12: providesEventBus

@Provides
@Singleton
public Bus providesEventBus() {
    return new Bus(ThreadEnforcer.MAIN);
}
 
开发者ID:tevjef,项目名称:Vapor,代码行数:5,代码来源:VaporModule.java

示例13: provideBus

@Provides
@Singleton
Bus provideBus() {
    return new Bus(ThreadEnforcer.MAIN);
}
 
开发者ID:nguyenhuy,项目名称:buffer,代码行数:5,代码来源:ApplicationModule.java

示例14: AndroidBus

public AndroidBus() {
    super(ThreadEnforcer.MAIN);
}
 
开发者ID:tapchat,项目名称:tapchat-android,代码行数:3,代码来源:AndroidBus.java

示例15: PostFromAnyThreadBus

public PostFromAnyThreadBus() {
    super(ThreadEnforcer.MAIN);
}
 
开发者ID:byoutline,项目名称:EventCallback,代码行数:3,代码来源:PostFromAnyThreadBus.java


注:本文中的com.squareup.otto.ThreadEnforcer.MAIN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。