Search code examples
androidlabelandroid-recents

android application does not show in the recent application tab


When i use the Label attribute in the manifest for an activity, it does not show in the recent application list. Code for activity in manifest file is:

<activity
        android:name=".MainActivity"
        android:screenOrientation="portrait" 
        android:theme="@style/MyTheme"
        android:icon="@drawable/ic_launcher"
        android:label=""
        >
        <intent-filter android:label="@string/app_name">
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

when i use android:label="@string/app_name" , then it start showing in the recent tab, but i dont want activity label.


Solution

  • Your application is not visible in recent apps list because label of your main activity is empty.

    Change

    <activity...  android:label="">
    

    To

    <activity... android:label="@string/some_name">
    

    Edit:

    If you don't want to show label for your activity then do the following.

    You must set android:label="@string/some_name" in <activity> tag

    And then write getActionBar().setDisplayShowTitleEnabled(false); in onCreate() method of your activity you want to hide label of.

    This will let you hide the activity label and will show your app in recent apps list as well.