How can I get the service name programmatically in Android?
Say I have this piece of code:
public class MainActivity extends Activity { private MyService mService;
Suppose I want to fry a service name, which could be like com.example.MyService .
Is it possible to get it from the mService variable?
Currently, I got it using MyService this way
MyService.class.getName()
source share