I have a AppConstants class where I have some static variables and static methods. Variable like
public static final String BASE_URL = "http://www.somevalue.com/api/";
private static String MID_FIX_API;
public static final String API_CALL = BASE_URL + getMidFixApi() + "/" + GET_KEY(appContext, KEY_FOR_KEY);
As MID_FIX_API is private so I have its public getter/setter.
When I set its value from another class by its setter method AppConstants.setMidFixApi("value"); and get its value from its getter method AppConstants.getMidFixApi(); Everything is fine till now
But
The problem comes when after the above lines I call static variable API_CALL shown in the code above that get value from the getter of the variable MID_FIX_API and return null despite of that we have passed value to it before.
This is the whole sequence of lines
AppConstants.setMidFixApi("getCategories"); // setting value
Log.e("InsideSuccess", "MID_FIX_API = " + AppConstants.getMidFixApi()); // working fine till here
Log.e("InsideSuccess", "API_URL = "+AppConstants.API_CALL); // here I'm getting like this http://www.somevalue.com/api/null/somePostFix
Please point me what I'm doing wrong.