Java android EventBus 检测服务器是否发送到手机消息

标签 java android event-bus

我想使用 EventBus 来检测服务器是否发送了某些内容

我注册了一个eventBus:

App.getBus().register(this);
public static App getInstance() {
    return instance;
}

public static EventBus getBus() {
    return EventBus.getDefault();
}

但我不知道如何检测服务器是否发送了某些内容

最佳答案

I don't have idea how I can detect if server is send something

EventBus 用于在应用程序中发送事件,它不能用于通过互联网从服务器向客户端发送消息。服务器向客户端发送消息可以使用 FCM 来实现由谷歌提供。

关于Java android EventBus 检测服务器是否发送到手机消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43089603/

相关文章:

android - 适用于没有 Google Play 服务的 Android 设备的 Flurry

java - 从 Guava EventBus 订阅者抛出异常

java - 该类型的方法 DataOutputStream(OutputStream) 未定义

Java 多线程与 Guava EventBus

java - 如何使用 Vert.x 从 EventBus 中获取结果

java - Windows 10 上的错误 : Unable to access jarfile metabase. jar

java - 出现错误匹配器异常的无效用户

java - 为什么 Admob 横幅广告不向我展示? [Android,libGDX]

java - @Transactional Controller 方法不起作用

java - SlidingMenu 宽度不正确