Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Manifest: Why sometimes ".<classname>" instead of just "<classname>"?

What does the dot mean?

most of the time I just write that:

<activity android:name="OneActivity" ...>...</activity>

But sometimes I see in the autogenerated file:

<activity android:name=".OtherActivity" ...>...</activity>

And also in the Docs for Service I see that they write

<manifest ... >
  ...
  <application ... >
      <service android:name=".ExampleService" />
      ...
  </application>
</manifest>

But I never saw any differences in trying the one or the other.

like image 362
erikbstack Avatar asked Sep 07 '11 08:09

erikbstack


1 Answers

If you take a look at above, there is package definition like

package="app.package.name"

The class name with the dot means that that class is under the defined package. If you have another package like

app.package.name.another

and there is a class in that package, you have to defined class name like

<activity android:name=".another.activityname"
like image 72
Hein Avatar answered Oct 04 '22 03:10

Hein