Skip to content

Instantly share code, notes, and snippets.

@bgorkowy
Forked from cyrilmottier/AndroidManifest.xml
Created April 8, 2014 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgorkowy/10199826 to your computer and use it in GitHub Desktop.
Save bgorkowy/10199826 to your computer and use it in GitHub Desktop.
Android example of how to add a custom logo to the ActionBar and ensure the best possible matching starting Window.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cyrilmottier.android.anapp">
<!-- ... -->
<application
android:icon="@drawable/ic_launcher"
android:label="@string/config_app_name"
android:theme="@style/Theme.AnApp" >
<activity
android:name="com.cyrilmottier.android.anapp.LauncherActivity"
android:theme="@style/Theme.AnApp.Logo">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- ... -->
</application>
</manifest>
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="Widget.ActionBar" parent="...">
<!-- ... -->
</style>
<style name="Widget.ActionBar.Logo">
<item name="android:logo">@drawable/app_text_logo</item>
<item name="android:displayOptions">useLogo|showHome</item>
</style>
</resources>
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="Theme.AnApp" parent="...">
<item name="android:actionBarStyle">@style/Widget.ActionBar</item>
<!-- ... -->
</style>
<style name="Theme.AnApp.Logo">
<item name="android:actionBarStyle">@style/Widget.ActionBar.Logo</item>
<!-- ... -->
</style>
</resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment