[Solved] Why use ‘$’ instead of ‘.’? [closed]


It is suggested to use $ in order not to confuse the outer class name with the package name. So $ when you want to refer to an InnerClass and . when referring to the package.

For example if Helper is a package name then (lowercase is suggested for package names):

<service android:name=".helper.LocationService"/>

where if Helper is a class and LocationService is an inner class defined inside Helper

<service android:name=".Helper$LocationService"/>

1

solved Why use ‘$’ instead of ‘.’? [closed]