ComponentName extension function for Context
What do you think about a simple extension for creating ComponentName instances using a Context?
inline fun <reified T> Context.componentName() = ComponentName(this, T::class.java)
Should there be an overload which takes a string as well?
Sure, I don't see why not... hmm. Would there be a case where you have a Component you don't have the class reference for? Yes, actually if the Component is in another application. Though in that case, you would not be using a Context from your application to create it.
There must be a use case why that constructor exists. I'm not sure when ComponentName(context, string) is generally used, or if it is merely a convenience method. It does result in one less function call since it does not need to call getName() on the class to get the String value.
Shrug I'd lean towards not including the string constructor unless I am missing a general use case where this would be useful.
Find this really usefull. PR #594