Placing an Icon in the Activity title bar

JTolhurst

Member
Licensed User
Longtime User
Hi,
I was going through some of the examples and came acros the Search view example where the activity title bar contained an icon (and the styling was different). Can anyone explain how this is achieved, or point me in the direction of a post that may already explain this (I did a quick search but haven't come across the answer)??
Thank You
 
Changing Icon in Title

Folks,
So I take it that other than the change mentioned by Erel, you cannot embed your own icon in the title?
 
Upvote 0
I have 3 apps, in two I can see the icon in the title and in the third I can not,
I cant figureout whats the differece between them

BTW I can se the icons only on ICS phones

any idea ? - THANKS

manifest that is not shoing the icon: (BTW I removed the line 'android:theme="@android:style/Theme.Translucent">' just to be sure it is not what causeing it, and its not.

Code: Copy
<?xml version="1.0" encoding="utf-8"?>
<manifest
   xmlns:android="http://schemas.android.com/apk/res/android"
   package="appsright.quickvolumemanager"
   android:versionCode="1"
   android:versionName=""
   android:installLocation="internalOnly">
   
   <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
   <supports-screens android:largeScreens="true" 
       android:normalScreens="true" 
       android:smallScreens="true" 
       android:anyDensity="true"/>
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
   <uses-permission android:name="android.permission.VIBRATE"/>
   <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
   <application
      android:icon="@drawable/icon"
      android:label="QuickVolumeManager"
      android:theme="@android:style/Theme.Translucent">
      <activity
         android:windowSoftInputMode="stateHidden"
         android:launchMode="singleTop"
         android:name=".main"
         android:label="QuickVolumeManager"
         android:screenOrientation="unspecified">
         <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
         
      </activity>
      <service android:name=".qvmservice">
      </service>
      <receiver android:name=".qvmservice$qvmservice_BR">
         <intent-filter>
         <action android:name="android.intent.action.BOOT_COMPLETED"/>
         </intent-filter>
         <intent-filter>
             <action android:name="android.intent.action.MEDIA_BUTTON" />
             </intent-filter>
         <intent-filter>
             <action android:name="android.media.VOLUME_CHANGED_ACTION" />
             </intent-filter>
      </receiver>
   </application>
</manifest>

one that show icon:
Code: Copy
<?xml version="1.0" encoding="utf-8"?>
<manifest
   xmlns:android="http://schemas.android.com/apk/res/android"
   package="appsright.missedcallsnotifier"
   android:versionCode="1"
   android:versionName=""
   android:installLocation="internalOnly">
   
   <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
   <supports-screens android:largeScreens="true" 
       android:normalScreens="true" 
       android:smallScreens="true" 
       android:anyDensity="true"/>
   <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
   <uses-permission android:name="android.permission.READ_CONTACTS"/>
   <uses-permission android:name="android.permission.VIBRATE"/>
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
   <uses-permission android:name="android.permission.INTERNET"/>
   <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
   <application
      android:icon="@drawable/icon"
      android:label="MissedCallsNotifier">
      <activity
         android:windowSoftInputMode="stateHidden"
         android:launchMode="singleTop"
         android:name=".main"
         android:label="MissedCallsNotifier"
         android:screenOrientation="unspecified">
         <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
         
      </activity>
      <service android:name=".monitormissedcalls">
      </service>
      <receiver android:name=".monitormissedcalls$monitormissedcalls_BR">
         <intent-filter>
         <action android:name="android.intent.action.BOOT_COMPLETED"/>
         </intent-filter>
         <intent-filter>
             <action android:name="android.intent.action.PHONE_STATE" />
             </intent-filter>
         <intent-filter>
             <action android:name="ACTION_PHONE_STATE_CHANGED" />
             </intent-filter>
      </receiver>
   </application>
</manifest>
 
Upvote 0
Back
Top