public static void GetAllPoints(final IGetAllPointsCallBack callBack) {
SharedPreferences entity = getSharedPreferences("settings",MODE_PRIVATE);
String savedValue = entity.getString("entityGUID",null);
}
getSharedPreferences
is not working here, is there a way to call it inside my method while I save its value in another class ?
I am saving my preferences like this:
EntityType selectedItem = ApplicationController.entities.get(which);
SharedPreferences.Editor savedValue = getSharedPreferences("settings",MODE_PRIVATE).edit();
savedValue.putString("entityGUID", String.valueOf(selectedItem.EntityGUID));
savedValue.apply();
I needed to make my method static is because I am accessing it from another class:
public void showAllSpots()
{
DataService.GetAllPoints(newDataService.IGetAllChargingPointsCallBack() {
@Override
public void Success(ArrayList<ChargingSpot> chargingSpots) {
//
}
});
}