title: How to display Android Action Bar Logo
body: <p>I am following the Android Developers Guild</p>
  
  <p>I want to have the green robot logo on the very left hand side of the action bar
  <a href="http://developer.android.com/images/training/basics/actionbar-theme-custom@2x.png" rel="nofollow">http://developer.android.com/images/training/basics/actionbar-theme-custom@2x.png</a></p>
  
  <p>but I do not have the logo on action bar at all. I have searched for a few days, still can not locate an answer for this.</p>
  
  <p>Please help, thanks!</p>
  
  <p>src/.../MainActivity.java</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
      public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          getSupportActionBar().setDisplayUseLogoEnabled(true);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu items for use in the action bar
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.action_bar, menu);
          return super.onCreateOptionsMenu(menu);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle presses on the action bar items
          switch (item.getItemId()) {
              case R.id.action_tab:
                  ActionBar.openTab(this);
                  return true;
              case R.id.action_search:
                  ActionBar.openSearch(this);
                  return true;
              case R.id.action_settings:
                  ActionBar.openSettings(this);
                  return true;
              default:
                  return super.onOptionsItemSelected(item);
          }
      }
  
      /** Called when the user clicks the Send button */
      public void sendMessage(View view) {
          Intent intent = new Intent(this, DisplayMessageActivity.class);
          EditText editText = (EditText) findViewById(R.id.edit_message);
          String message = editText.getText().toString();
          intent.putExtra(EXTRA_MESSAGE, message);
          startActivity(intent);
      }
  }
  </code></pre>
  
  <p>menu/action_bar.xml</p>
  
  <pre><code>    &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
      &lt;!-- Tab, should appear as action button --&gt;
      &lt;item android:id="@+id/action_tab"
            android:title="@string/action_tab"
            app:showAsAction="always" /&gt; &lt;!-- you can change "always" to "ifRoom" --&gt;
      &lt;!-- Search, should appear as action button --&gt;
      &lt;item android:id="@+id/action_search"
            android:icon="@drawable/ic_action_search"
            android:title="@string/action_search"
            app:showAsAction="always" /&gt; &lt;!-- you can change "always" to "ifRoom|withText" --&gt;
      &lt;!-- Settings, should always be in the overflow --&gt;
      &lt;item android:id="@+id/action_settings"
            android:title="@string/action_settings"
            app:showAsAction="never" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>res/values/themes.xml</p>
  
  <pre><code>&lt;resources&gt;
      &lt;!-- the theme applied to the application or activity --&gt;
      &lt;style name="CustomActionBarTheme"
             parent="@style/Theme.AppCompat.Light"&gt;
          &lt;item name="android:actionBarStyle"&gt;@style/MyActionBar&lt;/item&gt;
          &lt;item name="android:actionMenuTextColor"&gt;@color/actionbar_otherthantitleandoverflowtext&lt;/item&gt;
          &lt;item name="android:windowActionBarOverlay"&gt;false&lt;/item&gt;
  
          &lt;!-- Support library compatibility --&gt;
          &lt;item name="actionBarStyle"&gt;@style/MyActionBar&lt;/item&gt;
          &lt;item name="actionMenuTextColor"&gt;@color/actionbar_otherthantitleandoverflowtext&lt;/item&gt;
          &lt;item name="windowActionBarOverlay"&gt;false&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;!-- ActionBar styles --&gt;
      &lt;style name="MyActionBar"
             parent="@style/Widget.AppCompat.ActionBar"&gt;
          &lt;item name="android:background"&gt;@color/actionbar_background&lt;/item&gt;
          &lt;item name="android:titleTextStyle"&gt;@style/MyActionBarTitleText&lt;/item&gt;
  
          &lt;!-- Support library compatibility --&gt;
          &lt;item name="background"&gt;@color/actionbar_background&lt;/item&gt;
          &lt;item name="titleTextStyle"&gt;@style/MyActionBarTitleText&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;!-- ActionBar title text --&gt;
      &lt;style name="MyActionBarTitleText"
             parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"&gt;
          &lt;item name="android:textColor"&gt;@color/actionbar_titletext&lt;/item&gt;
          &lt;!-- The textColor property is backward compatible with the Support Library --&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>Manifest.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.myfirstapp"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="11"
          android:targetSdkVersion="21" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:logo="@drawable/ic_launcher"
          android:theme="@style/CustomActionBarTheme" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/title_activity_main" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".DisplayMessageActivity"
              android:label="@string/title_activity_display_message"
              android:parentActivityName=".MainActivity" &gt;
              &lt;!-- Parent activity meta-data to support 4.0 and lower --&gt;
              &lt;meta-data
                  android:name="android.support.PARENT_ACTIVITY"
                  android:value="com.example.myfirstapp.MainActivity" /&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>