I'm working on a simple multiplayer game on android. I have NetworkManager class which opens connection to the server and provides methods like send and receive.
public class NetworkManager { private Socket socket; public NetworkManager() throws IOException { socket = new Socket(HOST, PORT); ... } public void send(String msg) throws IOException { ... } } In one activity I connect to the server by creating new instance of NetworkManager. Then, I have to use that instance in several other activities. Is it possible to pass reference to it when starting new activity?