Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Apparently <code>&lt;intent-filter&gt;</code> can have a label attribute. If it's absent the label is inherited from the parent component (either Activity or Application). So using this, you can set a label for the launcher icon, while still having the Activity with it's own title.</p> <p>Note that, while this works on emulators, it might not work on real devices, because it depends on the launcher implementation that is used.</p> <p><a href="http://developer.android.com/guide/topics/manifest/intent-filter-element.html" rel="noreferrer">http://developer.android.com/guide/topics/manifest/intent-filter-element.html</a></p> <pre><code>&lt;activity android:name=".ui.HomeActivity" android:label="@string/title_home_activity" android:icon="@drawable/icon"&gt; &lt;intent-filter android:label="@string/app_name"&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <blockquote> <p>Side Note: &lt;intent-filter> can also have an icon attribute, but inexplicably it does <em>not</em> override the icon specified in the Activity. This may be important to you if you plan to use the native ActionBar in SDK 11+, which uses Icon and Logo specified on the Activity.</p> </blockquote> <p><strong>Added Info:</strong> The label is being inherited from Activity and not the Application.</p> <pre><code> &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name=".StartActivity" android:label="@string/app_long_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>In this case, app_long_name will be displayed with launcher icon, if we do not put label inside as mentioned above.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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