changed session to a singleton method.
This commit is contained in:
@@ -40,7 +40,7 @@ public class Main extends Application {
|
|||||||
base = root;
|
base = root;
|
||||||
baseController = (BaseController) loader.getController();
|
baseController = (BaseController) loader.getController();
|
||||||
baseController.setParent(this);
|
baseController.setParent(this);
|
||||||
this.session = new Session();
|
this.session = Session.session;
|
||||||
try{
|
try{
|
||||||
DataManagerSerialiser dataManagerSerialiser = new DataManagerSerialiser();
|
DataManagerSerialiser dataManagerSerialiser = new DataManagerSerialiser();
|
||||||
DataManager dataManager = dataManagerSerialiser.load();
|
DataManager dataManager = dataManagerSerialiser.load();
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ public class Session {
|
|||||||
|
|
||||||
private String userCode;//this is like fwy13
|
private String userCode;//this is like fwy13
|
||||||
DataManager dataManager;
|
DataManager dataManager;
|
||||||
|
public static Session session = new Session();
|
||||||
|
|
||||||
public Session(){
|
public Session(){
|
||||||
|
session = this;
|
||||||
dataManager = new DataManager();
|
dataManager = new DataManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user