Listening socket.io events and updating LiveData (a class of android.arch.lifecycle)in application class android
问题 I am working on a chat application and Currently I am listening and emitting socket events in an Activity. Now i want to listen all the socket events even when chat activity is not in foreground as i want to store all the messages from different users in the local DB at the same time i want to update LiveData to update UI. In order to achieve this I am listening socket events in the Application class as following: public class ChatApplication extends Application { public Socket mSocket;