我想使用 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/