當前位置: 首頁>>代碼示例>>Java>>正文


Java ThreadEnforcer.ANY屬性代碼示例

本文整理匯總了Java中com.squareup.otto.ThreadEnforcer.ANY屬性的典型用法代碼示例。如果您正苦於以下問題:Java ThreadEnforcer.ANY屬性的具體用法?Java ThreadEnforcer.ANY怎麽用?Java ThreadEnforcer.ANY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.squareup.otto.ThreadEnforcer的用法示例。


在下文中一共展示了ThreadEnforcer.ANY屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

@Override
    public void onCreate() {
        super.onCreate();
        bus = new Bus(ThreadEnforcer.ANY);

        list = new ArrayList<>();
        StringBuffer buffer = new StringBuffer();
        try (BufferedReader input = new BufferedReader(
                new InputStreamReader(
                        openFileInput(RSS_FILE)))) {
            String line;
            while ((line = input.readLine()) != null) {
                buffer.append(line);
            }
        } catch (Exception ex) {
// do nothing
        }
        if (buffer!=null && buffer.length()>0 )
        {
            Gson gson = new Gson();
            Type type = new TypeToken<List<RssItem>>() {}.getType();
            List<RssItem> fromJson = gson.fromJson(buffer.toString(), type);
            list.addAll(fromJson);
        }
    }
 
開發者ID:vogellacompany,項目名稱:codeexamples-android,代碼行數:25,代碼來源:RssApplication.java

示例2: PerfTestOtto

public PerfTestOtto(Context context, TestParams params) {
    super(context, params);
    eventBus = new Bus(ThreadEnforcer.ANY);
    subscribers = new ArrayList<Object>();
    eventCount = params.getEventCount();
    expectedEventCount = eventCount * params.getSubscriberCount();
    subscriberClass = Subscriber.class;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:PerfTestOtto.java

示例3: bus

public static Bus bus() {
    Bus localInstance = instance;
    if (localInstance == null) {
        synchronized (AndroidBus.class) {
            localInstance = instance;
            if (localInstance == null) {
                instance = localInstance = new AndroidBus(ThreadEnforcer.ANY);
            }
        }
    }
    return localInstance;
}
 
開發者ID:trigor74,項目名稱:travelers-diary,代碼行數:12,代碼來源:BusProvider.java

示例4: provideBus

/**
 * 提供全局單例的event bus
 */
@Provides
@Singleton
public Bus provideBus() {
    // our event bus running on any thread
    return new Bus(ThreadEnforcer.ANY);
}
 
開發者ID:xulailing,項目名稱:android-open-project-demo-master,代碼行數:9,代碼來源:DaggerModule.java

示例5: AndroidMiniClientOptions

AndroidMiniClientOptions(Application ctx) {
    this.prefs=new AndroidPrefStore(PreferenceManager.getDefaultSharedPreferences(ctx));
    this.configDir = ctx.getFilesDir();
    this.cacheDir = ctx.getCacheDir();
    this.bus = new OttoBusImpl(new Bus(ThreadEnforcer.ANY));
    this.isTV = ctx.getResources().getBoolean(R.bool.istv);
    this.isTOUCH = !isTV;
    this.advancedAspects=true;
}
 
開發者ID:OpenSageTV,項目名稱:sagetv-miniclient,代碼行數:9,代碼來源:AndroidMiniClientOptions.java

示例6: bus

public static Bus bus() {
    Bus localInstance = instance;
    if (localInstance == null) {
        synchronized (Bus.class) {
            localInstance = instance;
            if (localInstance == null) {
                instance = localInstance = new Bus(ThreadEnforcer.ANY);
            }
        }
    }
    return localInstance;
}
 
開發者ID:pmk2429,項目名稱:investickation,代碼行數:12,代碼來源:BusProvider.java

示例7: onCreate

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    downloadButton = (Button) findViewById(R.id.button);
    notificationText = (TextView) findViewById(R.id.textView);
    notificationInfo = (TextView) findViewById(R.id.textViewInfo);
    downloadButton.setOnClickListener(this);
    bus = new Bus (ThreadEnforcer.ANY);
    bus.register(this);
    downloadInformation = new RestActorSource(bus);
}
 
開發者ID:JaimeToca,項目名稱:RetrofitOttoExample,代碼行數:12,代碼來源:MainActivity.java

示例8: setUp

@Before public void setUp() throws Exception {
  this.busWrapper = new OttoBusWrapper(new Bus(ThreadEnforcer.ANY));
  Logger logger = Mockito.mock(Logger.class);
  Context context = Mockito.mock(Context.class);
  OnlineChecker onlineChecker = Mockito.mock(OnlineChecker.class);
  this.receiver = new NetworkConnectionChangeReceiver(busWrapper, logger, context, onlineChecker);
  this.connectivityChangeEvents = new ArrayList<>();
}
 
開發者ID:pwittchen,項目名稱:NetworkEvents,代碼行數:8,代碼來源:NetworkConnectionChangeReceiverTest.java

示例9: setUp

@Before public void setUp() throws Exception {
  this.busWrapper = new OttoBusWrapper(new Bus(ThreadEnforcer.ANY));
  Logger logger = Mockito.mock(Logger.class);
  Context context = Mockito.mock(Context.class);
  this.receiver = new InternetConnectionChangeReceiver(busWrapper, logger, context);
  this.connectivityChangeEvents = new ArrayList<>();
}
 
開發者ID:pwittchen,項目名稱:NetworkEvents,代碼行數:7,代碼來源:InternetConnectionChangeReceiverTest.java

示例10: getInstance

public static Bus getInstance() {
	if (mInstance == null) {
		mInstance = new Bus(ThreadEnforcer.ANY);
	}
	if (statProducer == null) {
		statProducer = new UploadStatusEventProducer();
		statProducer.register(mInstance);
	}
	return mInstance;
}
 
開發者ID:DarrenMowat,項目名稱:PicSync,代碼行數:10,代碼來源:DataBus.java

示例11: provideBus

/**
 * Provides the event bus for the application.
 *
 * @return the application event bus.
 */
@Provides
Bus provideBus() {
    if (mBus == null)
        mBus = new Bus(ThreadEnforcer.ANY);
    return mBus;
}
 
開發者ID:enviroCar,項目名稱:enviroCar-app,代碼行數:11,代碼來源:BaseApplicationModule.java

示例12: onCreate

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

	bus = new Bus(ThreadEnforcer.ANY);
	
	Crittercism.initialize(getApplicationContext(), "527b160b8b2e3376d3000003");
}
 
開發者ID:madhur,項目名稱:GAnalytics,代碼行數:9,代碼來源:App.java

示例13: setupForTesting

@RestrictTo(RestrictTo.Scope.TESTS)
public static void setupForTesting() {
    sBus = new Bus(ThreadEnforcer.ANY);
}
 
開發者ID:TryGhost,項目名稱:Ghost-Android,代碼行數:4,代碼來源:BusProvider.java

示例14: onCreate

@Override
public void onCreate() {
    super.onCreate();
    AndroidGraphicFactory.createInstance(this);
    mOttoBus = new Bus(ThreadEnforcer.ANY);
}
 
開發者ID:yuviii,項目名稱:OfflineMap,代碼行數:6,代碼來源:App.java

示例15: busProvider

public Bus busProvider() {
    return new Bus(ThreadEnforcer.ANY);
}
 
開發者ID:sanidhya09,項目名稱:androidprojectbase,代碼行數:3,代碼來源:UtilityClass.java


注:本文中的com.squareup.otto.ThreadEnforcer.ANY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。