I trying to develop an android app, where I need to make a static(PLACES_API_BASE) reference to a non-static variable.Please check out the below code.
private static final String PLACES_API_BASE= getResources().getString(R.string.places_api_base);
But, I am getting an error stating,
Cannot make a static reference to the non-static method getResources() from the type
Is there any possible work around to achieve this. Please help. Thanks!
final
? – brwngrldev Jan 14 '14 at 4:48final
has nothing to do with it. – alfasin Jan 14 '14 at 4:48final
isn't the real issue here; not understanding objects is. – Brian Roach Jan 14 '14 at 4:58