2

I'm using a logo in my application's action bar in my main activity.

When I launch my app, the app's icon and title label appear in place of the logo for a split second.

If I remove the label and icon attribute from the manifest, I lose the launcher icon from the app drawer and home screen, and the app's name is replaced with the package name.

If I add the logo attribute alongside the icon and label attribute, the app title flashes alongside the logo for a split second instead.

How do I get my app to startup with just the logo in the action bar but leave everything else like it should be?

Here is the relevant manifest snippet:

<application
    android:name=".activities.MyApplication"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.hello" >

    <activity
        android:name=".activities.MainActivity"
        android:launchMode="singleTop"
        android:logo="@drawable/ic_leanpocket_logo" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
joepetrakovich
  • 1,344
  • 3
  • 24
  • 42

2 Answers2

1

Maybe this answer can help you. It helped me.

<quote>
Best method is to set the display options to useLogo in your theme. E.g.

<style name="AppTheme" parent="android:Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/AppTheme.ActionBar</item>
</style>

<style name="AppTheme.ActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid">
    <item name="android:displayOptions">useLogo</item>
</style>

This won't actually show the logo (if set) because showHome is not included.
</quote>

Community
  • 1
  • 1
sandalone
  • 41,141
  • 63
  • 222
  • 338
-1

use Theme of No Title

Example

 <activity
        android:name=".activities.MainActivity"
        android:launchMode="singleTop"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Black.NoTitleBar" > // Like this
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

Edit 1: For Activity Title only (not for Application Title)

this.setTitle("");

By setting title to empty string you can achieve what you want

Community
  • 1
  • 1
Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95