Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a leading dot in an android:name mean?

What is the difference between these two ways of setting the android:name field?

I seen both type and not sure why they are written these two different ways

one way I see often is (notice the "." between " and "Server"):

  android:name=".Server" 

the other way without the extra "." before the name:

 android:name="Server"

sample xml

  <service
        android:name=".Server"
        android:icon="@drawable/ic_launcher"
        android:label="audioservice"
        android:process=":my_process" >
    </service>

     <activity android:name=".DBView"> 
        <intent-filter >
            <action android:name="com.example.test.DBVIEW"/>
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
like image 575
Kevik Avatar asked Dec 30 '25 10:12

Kevik


1 Answers

Look at this.

The name of the Service subclass that implements the service. This should be a fully qualified class name (such as, "com.example.project.RoomService"). However, as a shorthand, if the first character of the name is a period (for example, ".RoomService"), it is appended to the package name specified in the element.

like image 129
zeyuec Avatar answered Jan 02 '26 02:01

zeyuec