Android how to add ic_lancher on action bar



I am using android navigation Drawer. created by eclipse. I want to add my ic_launcher on the action bar. as it would normally show.


I also set the min API to 14.


styles //-------------------------------------------------------------------------------------------



<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>

<!-- Support library compatibility -->
<item name="actionBarStyle">@style/MyActionBar</item>
</style>

<!-- ActionBar styles -->
<style name="MyActionBar"
parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:background">@color/orange_dark</item>

<!-- Support library compatibility -->
<item name="background">@color/orange_dark</item>
</style>


here is my manifest



<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />


<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />


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

<activity
android:name=".SplashScreen"
android:label="@string/title_activity_splash_screen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>


<activity
android:name=".MainActivity"
android:label="@string/app_name" >
</activity>

No comments:

Post a Comment