But in solution I linked the information, about being in the background or the foreground, is stored in a static field, which does not depend on instance of an object. Read about class variables: http://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html