Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I got curious too, and went looking for it in the Android source code.</p> <p>I found what seems to be the relevant code at the <code>platform/frameworks/base</code> repository, in the <code>tools/aapt/Resource.cpp</code> file. The relevant function is <code>fullyQualifyClassName</code>, called by <code>massageManifest</code>.</p> <p>The rule it applies is explained in a comment block within the <code>fullyQualifyClassName</code> function:</p> <pre><code>// asdf --&gt; package.asdf // .asdf .a.b --&gt; package.asdf package.a.b // asdf.adsf --&gt; asdf.asdf </code></pre> <p>Explaining this rule, we have:</p> <ol> <li>If the name starts with a dot, always prefix it with the package.</li> <li>If the name has a dot anywhere else, do not prefix it.</li> <li>If the name has no dot at all, also prefix it with the package.</li> </ol> <p>So, to answer your question: as long as there is no dot anywhere else, both ways of writing the activity name should have the same effect.</p> <hr> <p>As an extra, the <code>massageManifest</code> function shows where this rule is applied:</p> <ul> <li>In the <code>application</code> element, on the <code>name</code> and <code>backupAgent</code> attributes.</li> <li>In the <code>activity</code>, <code>service</code>, <code>receiver</code>, <code>provider</code>, and <code>activity-alias</code> elements, on the <code>name</code> attribute.</li> <li>In the <code>activity-alias</code> element, on the <code>targetActivity</code> attribute.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload