So, I have to create few items, like Buttons and TextViews, from a service.
Since I need to pass along a Context when I create a new one, and since my service doesn't have one, I thought about doing it like this
Button button = new Button(getApplicationContext());
I never used
Service instances for that so, this is new for me. However, I stumbled upon this question about overlay service which gives quite cool solutions. As per your question I guess the following should work within the scope of your
Service and is safer:
Button myButton = new Button(this);