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


Java ThreadMode.BACKGROUND屬性代碼示例

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


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

示例1: setCity

/**
 * 設置當前城市
 * @param amapLocation
 */
@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void setCity(AMapLocation amapLocation) {
    if(amapLocation!=null){
        this.city = amapLocation.getCity();
    }
}
 
開發者ID:Vicent9920,項目名稱:MyMap,代碼行數:10,代碼來源:PoiSearchActivity.java

示例2: onObdJob

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onObdJob(ObdJobEvent obdJobEvent) {

    String name = obdJobEvent.getObdCommandJob().getObdCommand().getName();
    String result = obdJobEvent.getObdCommandJob().getObdCommand().getResult();

    if (result == null) {

    } else if (result.equals("NODATA")) {
        log.debug(name + ": " + obdJobEvent.getObdCommandJob().getObdCommand().getResult());
    } else {
        String formattedResult = obdJobEvent.getObdCommandJob().getObdCommand().getFormattedResult();
        log.info(name + ": " + formattedResult);
        obdData.put(name, formattedResult + "  :::  " + new Date().getTime());
        getView().showObdData(obdData);
    }
}
 
開發者ID:kocur,項目名稱:Obd2-Tracker,代碼行數:17,代碼來源:MainPresenter.java

示例3: addFriend

@Subscribe(threadMode = ThreadMode.BACKGROUND,priority = 90)
public void addFriend(AddFriendEvent event) {
    Log.d(TAG, "addFriend: ");
    try {
        EMClient.getInstance().contactManager().addContact(event.getFriendName(), event.getReason());
        ThreadUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                mAddFriendView.onAddFriendSuccess();
            }
        });
    } catch (HyphenateException e) {
        e.printStackTrace();
        ThreadUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                mAddFriendView.onAddFriendFailed();
            }
        });
    }
}
 
開發者ID:Vicent9920,項目名稱:FanChat,代碼行數:21,代碼來源:AddFriendPresenterImpl.java

示例4: onAddNewDownloadTaskEvent

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onAddNewDownloadTaskEvent(AddNewDownloadTaskEvent addNewDownloadTaskEvent){
    VideoInfo videoInfo = addNewDownloadTaskEvent.getVideoInfo();
    DownloadTask downloadTask = new DownloadTask(
            UUIDUtil.genUUID(),videoInfo.getFileName(),
            ("m3u8".equals(videoInfo.getVideoFormat().getName())?"m3u8":"normal"),
            videoInfo.getVideoFormat().getName(),
            videoInfo.getUrl(),
            videoInfo.getSourcePageUrl(),
            videoInfo.getSourcePageTitle(),
            videoInfo.getSize());
    MainApplication.downloadManager.addTask(downloadTask);
}
 
開發者ID:xm0625,項目名稱:VBrowser-Android,代碼行數:13,代碼來源:MainActivity.java

示例5: onMessageEvent

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onMessageEvent(MessageEvent event){
    switch (event.event){
        case TokenHandler.DownChannelCase1:
            openDownChannel(event.message);
            break;
        case TokenHandler.DownChannelCase2:
            SendSynchronizeEvent(event.message);
            break;
        case TokenHandler.DownChannelCase3:
            SendPingRequest(event.message);
            break;
    }
}
 
開發者ID:raj10071997,項目名稱:Alexa-Voice-Service,代碼行數:14,代碼來源:DownChannel.java

示例6: onMessageEvent

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onMessageEvent(MessageEvent event){
    switch (event.event){
        case TokenHandler.FinishMainActivity:
            finish();
           break;
    }
}
 
開發者ID:raj10071997,項目名稱:Alexa-Voice-Service,代碼行數:8,代碼來源:MainActivity.java

示例7: onMessageEvent

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onMessageEvent(MessageEvent event){
    switch (event.event){
        case TokenHandler.SplashActivity:
                if(event.message.equals("finishSplashActivity"))
                {
                    Log.d("checkthismethod","splashscreen");
                    finish();

                }

            break;
    }
}
 
開發者ID:raj10071997,項目名稱:Alexa-Voice-Service,代碼行數:14,代碼來源:SplashActivitiy.java

示例8: onMessageEvent

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onMessageEvent(MessageEvent event){
    switch (event.event){
        case TokenHandler.SendAudioRequest:
            sendAudioRequest(requestBody,event.message);
            break;
        case TokenHandler.SendSpeechStartedEvent:
            SendSpeechStartedEvent(tokenfrompayload,event.message);
            break;
        case TokenHandler.SendSpeechFinishedEvent:
            SendSpeechFinishedEvent(tokenfrompayload,event.message);
            break;
    }
}
 
開發者ID:raj10071997,項目名稱:Alexa-Voice-Service,代碼行數:14,代碼來源:SendingAudio.java

示例9: onLoginFailure

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onLoginFailure(LoginFailedEvent event) {
    int tryCount = checker.getAndAdd(1);
    Log.w(TAG, "Could not login, try again #" + tryCount);
    if (tryCount < 3) {
        getDevice();
    } else {
        EventBus.getDefault().post(new ConnectionFailedEvent());
    }
}
 
開發者ID:freeloki,項目名稱:AndroidThings-BurglarAlarm,代碼行數:10,代碼來源:BurglarService.java

示例10: onEventBackgroundThread

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onEventBackgroundThread(TestEvent event) {
    eventsReceivedCount.incrementAndGet();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:PerfTestEventBus.java

示例11: onGrblGcodeSendEvent

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onGrblGcodeSendEvent(GcodeCommand event){
    serialWriteString(event.getCommandString());
}
 
開發者ID:zeevy,項目名稱:grblcontroller,代碼行數:4,代碼來源:GrblSerialService.java

示例12: onGrblRelatimeCommandEvent

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onGrblRelatimeCommandEvent(GrblRealTimeCommandEvent grblRealTimeCommandEvent){
    serialWriteByte(grblRealTimeCommandEvent.getCommand());
}
 
開發者ID:zeevy,項目名稱:grblcontroller,代碼行數:4,代碼來源:GrblSerialService.java

示例13: onGrblOkEvent

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onGrblOkEvent(GrblOkEvent event){
    completedCommands.offer(1);
}
 
開發者ID:zeevy,項目名稱:grblcontroller,代碼行數:4,代碼來源:FileStreamerIntentService.java

示例14: onGrblErrorEvent

@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onGrblErrorEvent(GrblErrorEvent event){
    shouldContinue = false;
}
 
開發者ID:zeevy,項目名稱:grblcontroller,代碼行數:4,代碼來源:FileStreamerIntentService.java

示例15: doSomething

@Subscribe(threadMode = ThreadMode.BACKGROUND)
    public void doSomething(Event event) {

        Log.i(TAG, "doSomething: " + Thread.currentThread().getName());
//        Toast.makeText(this, event.msg+ " do !", Toast.LENGTH_SHORT).show();
    }
 
開發者ID:pop1234o,項目名稱:BestPracticeApp,代碼行數:6,代碼來源:MainActivity.java


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