當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。