Hide app launcher icon in title bar when activity starts with android

I searched for SO but didn’t find similar questions, as I’m not sure how to put it in a sentence. I am using an ActionBarSherlock with a logo instead of a launch icon (i.e., 72x72 Icon) with text in the upper corner of the action.

When activity first loads, for a split second. I see the launcher icon and label defined in the manifest (as shown below) before the logo action bar appears. This home activity is very simple, so it does not do extra loading, which may cause a delay.

<application android:hardwareAccelerated="true" android:icon="@drawable/launcher_icon" android:label="@string/app_name" android:screenOrientation="portrait" > <activity android:name=".SplashScreenActivity" android:label="@string/app_name" android:logo="@drawable/ab_logo" android:theme="@android:style/Theme.Light.NoTitleBar" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".HomeActivity" android:label="@string/homeitle" android:logo="@drawable/ab_logo" android:theme="@style/MyTheme" > </activity> </application> 

I can make the text “disappear” by creating it in the same color as the background, but I cannot find a way to remove / hide the start icon from the action.

I have a splashscreen action set up (as shown above) that just loads my home activity where the problem occurs. This helps, but sometimes the problem occurs when loading activity.

 public class SplashScreenActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public void onResume() { super.onResume(); Intent i = new Intent(getBaseContext(), HomeActivity.class); startActivity(i); finish(); } } 

Does anyone know how to hide the launcher icon and title bar so that it does not appear until the ActionBarSherlock is displayed? Ideally, such a screen is not needed, as there are several ways to access activity that would avoid the pop-up screen shown above.

--- Update my theme file ----

  <style name="MyTheme" parent="Theme.Sherlock.ForceOverflow"> <item name="android:windowBackground">@color/white</item> <item name="android:actionBarStyle">@style/MyTheme.ActionBar</item> <item name="android:actionMenuTextColor">@color/white</item> <item name="actionBarStyle">@style/MyTheme.ActionBar</item> <item name="actionMenuTextColor">@color/white</item> </style> <style name="MyTheme.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse"> <item name="android:background">@color/blue</item> <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item> <item name="android:displayOptions">showHome|useLogo</item> <item name="displayOptions">showHome|useLogo</item> <item name="background">@color/blue</item> <item name="titleTextStyle"> @style/MyTheme.ActionBar.TitleTextStyle</item> </style> <style name="MyTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance"> <item name="android:textColor">@color/blue</item> </style> 
+7
source share
1 answer

Fixed by adding an icon to a style that matches the logo. This overrides the start icon.

  <style name="MyTheme.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse"> <item name="android:background">@color/infostop_blue</item> <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item> <item name="android:displayOptions">showHome|useLogo</item> <item name="displayOptions">showHome|useLogo</item> <item name="android:icon">@drawable/ab_logo</item> <item name="icon">@drawable/ab_logo</item> <item name="background">@color/blue</item> <item name="titleTextStyle"> @style/MyTheme.ActionBar.TitleTextStyle</item> </style> 
+10
source

All Articles