I have some classes within my application that need to call Android functions that require the Context as a parameter. I don\'t have it as the class is not a subclass of the
The best way is to follow Bean approach:
public class Example {
protected Context getContext() {
...
}
...
}
Then it depends on possibilities to access context. If class is fully independent then constructor parameter and private field seems best approach.
But that bean property way shields you from further code changes.