0

This should be a simple fix. My problem is that my launcher name is the same as my first activity. @string/app_name is my actual application name that I want it to show, but it is showing my first activity "Drafts" for the launcher. If I take out the @string/activity_drafts then the Launcher is correct, but then the first activity is my app_name which is not the behaviour I am looking for. I just want two seperate names for the launcher and the first activity's title and I'm not really sure what is going on here.

Manifest.xml

<application android:name="com.jordan.dictation.Dictation2Go"
    android:allowBackup="true"
    android:hardwareAccelerated="true"
    android:icon="@drawable/dp_launcher2"
    android:logo="@drawable/dp_white_logo"
    android:label="@string/app_name"
    android:theme="@style/MyTheme">
    <activity
        android:name="com.jordan.dictation.Draft_Activity"
        android:screenOrientation="portrait"
        android:label="@string/activity_drafts"
        >
            <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
    </activity>
Jordan Hochstetler
  • 1,308
  • 3
  • 17
  • 28

2 Answers2

2

I am not sure how to do it in manifest file, however you can do it programmatically in your activity:

setTitle("Activity title");

or

getActionBar().setTitle("Activity title");

EDIT: GOT IT!

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"            
        android:theme="@style/AppTheme">
        <activity
            android:name="com.example.so1.MainActivity"
            android:label="ACTIVITY NAME"
            >
            <intent-filter android:label="APP NAME">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

Note: Doing this might result in unexpected behavior upon device restart, e.g. with an unmodified Samsung S3, a shortcut on the home screen will be renamed to the activity's label. (See https://stackoverflow.com/a/7250902)

Community
  • 1
  • 1
Kuba Spatny
  • 26,618
  • 9
  • 40
  • 63
  • 1
    right... i did this too, but it doesn't look very professional, because when you enter the app for a split second it shows the launcher title and then changes to the activity title – Jordan Hochstetler Sep 23 '13 at 20:53
0

The icon and label set for an intent filter are used to represent a component whenever the component is presented to the user as fulfilling the function advertised by the filter. For example, a filter with " android.intent.action.MAIN " and " android.intent.category.LAUNCHER " settings advertises an activity as one that initiates an application — that is, as one that should be displayed in the application launcher. The icon and label set in the filter are therefore the ones displayed in the launcher.