当前位置: 首页>>代码示例>>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;未经允许,请勿转载。