0

I have two controllers and want to manipulate data between them.

In my first controller I have the following inside initalize()

currCity = SettingsController.getCity();
currLat = SettingsController.getLat();
currLon = SettingsController.getLon();

In my SettingsController (second controller) I have the following

public String getCity() {
    return currCity;
}

public String getLat() {
    return currLat;
}

public String getLon() {
    return currLon;
}

How would I go about making something like this work? As right now I get non-static method cannot be referenced from static context.

1 Answers1

-1

You can Singleton Pattern for the SettingsController.

But be careful with that pattern: What is so bad about singletons?

Community
  • 1
  • 1
marcosspn
  • 324
  • 3
  • 10