Home | History | Annotate | Download | only in manifest
      1 page.title=<activity-alias>
      2 @jd:body
      3 
      4 <dl class="xml">
      5 <dt>syntax:</dt>
      6 <dd><pre class="stx">&lt;activity-alias android:<a href="#enabled">enabled</a>=["true" | "false"]
      7                 android:<a href="#exported">exported</a>=["true" | "false"]
      8                 android:<a href="#icon">icon</a>="<i>drawable resource</i>"
      9                 android:<a href="#label">label</a>="<i>string resource</i>"
     10                 android:<a href="#nm">name</a>="<i>string</i>"
     11                 android:<a href="#prmsn">permission</a>="<i>string</i>"
     12                 android:<a href="#trgt">targetActivity</a>="<i>string</i>" &gt;
     13     . . .
     14 &lt;/activity-alias&gt;</pre></dd>
     15 
     16 <dt>contained in:</dt>
     17 <dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code></dd>
     18 
     19 <dt>can contain:</dt>
     20 <dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code>
     21 <br/><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a></code></dd>
     22 
     23 <dt>description:</dt>
     24 <dd>An alias for an activity, named by the {@code targetActivity} 
     25 attribute.  The target must be in the same application as the
     26 alias and it must be declared before the alias in the manifest.
     27 
     28 <p>
     29 The alias presents the target activity as a independent entity.
     30 It can have its own set of intent filters, and they, rather than the 
     31 intent filters on the target activity itself, determine which intents 
     32 can activate the target through the alias and how the system
     33 treats the alias.  For example, the intent filters on the alias may 
     34 specify the "<code>{@link android.content.Intent#ACTION_MAIN 
     35 android.intent.action.MAIN}</code>" 
     36 and "<code>{@link android.content.Intent#CATEGORY_LAUNCHER 
     37 android.intent.category.LAUNCHER}</code>" flags, causing it to be 
     38 represented in the application launcher, even though none of the 
     39 filters on the target activity itself set these flags.
     40 </p>
     41 
     42 <p>
     43 With the exception of {@code targetActivity}, {@code &lt;activity-alias&gt;} 
     44 attributes are a subset of <code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code> attributes.  
     45 For attributes in the subset, none of the values set for the target carry over
     46 to the alias.  However, for attributes not in the subset, the values set for 
     47 the target activity also apply to the alias.
     48 </p></dd>
     49 
     50 <dt>attributes:</dt>
     51 <dd><dl class="attr">
     52 <dt><a name="enabled"></a>{@code android:enabled}</dt>
     53 <dd>Whether or not the target activity can be instantiated by the system through 
     54 this alias &mdash; "{@code true}" if it can be, and "{@code false}" if not.  
     55 The default value is "{@code true}".
     56 
     57 <p>
     58 The <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element has its own 
     59 <code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all 
     60 application components, including activity aliases.  The 
     61 <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> and {@code &lt;activity-alias&gt;} 
     62 attributes must both be "{@code true}" for the system to be able to instantiate 
     63 the target activity through the alias.  If either is "{@code false}", the alias 
     64 does not work.
     65 </p></dd>
     66 
     67 <dt><a name="exported"></a>{@code android:exported}</dt>
     68 <dd>Whether or not components of other applications can launch the target activity 
     69 through this alias &mdash; "{@code true}" if they can, and "{@code false}" if not.  
     70 If "{@code false}", the target activity can be launched through the alias only by 
     71 components of the same application as the alias or applications with the same user ID.  
     72 
     73 <p>
     74 The default value depends on whether the alias contains intent filters.  The 
     75 absence of any filters means that the activity can be invoked through the alias
     76 only by specifying the exact name of the alias.  This implies that the alias 
     77 is intended only for application-internal use (since others would not know its name)  
     78 &mdash; so the default value is "{@code false}".
     79 On the other hand, the presence of at least one filter implies that the alias 
     80 is intended for external use &mdash; so the default value is "{@code true}".
     81 </p></dd>
     82 
     83 <dt><a name="icon"></a>{@code android:icon}</dt>
     84 <dd>An icon for the target activity when presented to users through the alias.  
     85 See the <code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code> element's 
     86 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#icon">icon</a></code> attribute for more information.
     87 
     88 <dt><a name="label"></a>{@code android:label}</dt>
     89 <dd>A user-readable label for the alias when presented to users through the alias.
     90 See the the <code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code> element's 
     91 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#label">label</a></code> attribute for more information.
     92 </p></dd>
     93 
     94 <dt><a name="nm">{@code android:name}</dt>
     95 <dd>A unique name for the alias.  The name should resemble a fully
     96 qualified class name.  But, unlike the name of the target activity, 
     97 the alias name is arbitrary; it does not refer to an actual class.  
     98 </p></dd>
     99 
    100 <dt><a name="prmsn"></a>{@code android:permission}</dt>
    101 <dd>The name of a permission that clients must have to launch the target activity 
    102 or get it to do something via the alias.  If a caller of 
    103 <code>{@link android.content.Context#startActivity startActivity()}</code> or
    104 <code>{@link android.app.Activity#startActivityForResult startActivityForResult()}</code>
    105 has not been granted the specified permission, the target activity will not be
    106 activated. 
    107 
    108 <p>This attribute supplants any permission set for the target activity itself.  If
    109 it is not set, a permission is not needed to activate the target through the alias.
    110 </p>
    111 
    112 <p>
    113 For more information on permissions, see the 
    114 <a href="{@docRoot}guide/topics/manifest/manifest-intro.html#perms">Permissions</a> 
    115 section in the introduction.
    116 </p></dd>
    117 
    118 <dt><a name="trgt"></a>{@code android:targetActivity}</dt>
    119 <dd>The name of the activity that can be activated through the alias.
    120 This name must match the {@code name} attribute of an 
    121 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code> element that precedes
    122 the alias in the manifest.
    123 </p></dd>
    124 </dl></dd>
    125 
    126 <!-- ##api level indication## -->
    127 <dt>introduced in:</dt>
    128 <dd>API Level 1</dd>
    129 
    130 <dt>see also:</dt>
    131 <dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code></dd>
    132 
    133 </dl>