本文整理匯總了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();
}
}
示例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);
}
}
示例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();
}
});
}
}
示例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);
}
示例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;
}
}
示例6: onMessageEvent
@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onMessageEvent(MessageEvent event){
switch (event.event){
case TokenHandler.FinishMainActivity:
finish();
break;
}
}
示例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;
}
}
示例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;
}
}
示例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());
}
}
示例10: onEventBackgroundThread
@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onEventBackgroundThread(TestEvent event) {
eventsReceivedCount.incrementAndGet();
}
示例11: onGrblGcodeSendEvent
@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onGrblGcodeSendEvent(GcodeCommand event){
serialWriteString(event.getCommandString());
}
示例12: onGrblRelatimeCommandEvent
@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onGrblRelatimeCommandEvent(GrblRealTimeCommandEvent grblRealTimeCommandEvent){
serialWriteByte(grblRealTimeCommandEvent.getCommand());
}
示例13: onGrblOkEvent
@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onGrblOkEvent(GrblOkEvent event){
completedCommands.offer(1);
}
示例14: onGrblErrorEvent
@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onGrblErrorEvent(GrblErrorEvent event){
shouldContinue = false;
}
示例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();
}