title: Display App Icon in action bar under api 11
body: <p>I'm writing simple tutorial app and for some reason my App icon is not showing up (I want to use it as navigate up button instead of the arrow).</p>
  
  <p>As stated in the topic, I want to do it on Api level 11, however all the sollutions I've found rely on setIcon method.</p>
  
  <pre><code>getActionBar().setIcon(R.drawable.ic_launcher); //only on API &gt;= 14
  </code></pre>
  
  <p>The fragment preview in Android studio 1.0.2 does show the icon, however the emulator does not, so I'd expect the resource is ok. Also, the search and delete icons are working like a charm. I've tried setting this both as Icon and a logo to no avail.</p>
  
  <p><strong>AndroidManifest.xml:</strong></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.yamba"
      android:versionCode="1"
      android:versionName="1.0"
      &gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET"/&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:theme="@style/Theme.AppCompat.Light"
          android:logo="@drawable/ic_launcher"
           &gt;
          &lt;activity
              android:parentActivityName=".MainActivity"
              android:name=".StatusActivity"
              android:label="@string/app_name" &gt;
          &lt;/activity&gt;
          &lt;!--- The labe is what's displayed at the taskbar!--&gt;
          &lt;activity
              android:parentActivityName=".MainActivity"
              android:name=".SettingsActivity"
              android:label="@string/title_activity_settings" &gt;
          &lt;/activity&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;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>activity_settings.xml</strong></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
      android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      android:paddingBottom="@dimen/activity_vertical_margin"
  
      tools:context="com.example.yamba.SettingsActivity"&gt;
  
      &lt;TextView android:text=""
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>menu_settings.xml</strong></p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      tools:context="com.example.yamba.SettingsActivity"&gt;
      &lt;item android:id="@+id/action_settings" android:title="@string/action_settings"
          android:orderInCategory="100" app:showAsAction="never" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p><strong>SettingsActivity.java</strong></p>
  
  <pre><code>package com.example.yamba;
  
  import android.annotation.TargetApi;
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Build;
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  
  
  public class SettingsActivity extends ActionBarActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          if (savedInstanceState == null){
              SettingsFragment fragment = new SettingsFragment();
              getFragmentManager().beginTransaction().add(android.R.id.content, fragment, fragment.getClass().getSimpleName()).commit();
              setContentView(R.layout.activity_settings);
  //            getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);
  //            only for API&gt;=14
  //            getActionBar().setDisplayShowHomeEnabled(true);
  //            getActionBar().setIcon(R.drawable.ic_launcher);
          }
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
  //        getMenuInflater().inflate(R.menu.menu_settings, menu);
  //        return true;
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
          switch(id){
              case R.id.action_settings:
                  startActivity(new Intent(this, SettingsActivity.class));
                  return true;
              case R.id.action_tweet:
                  startActivity(new Intent(this, com.example.yamba.StatusActivity.class));
                  return true;
              default:
                  return false;
          }
      }
  }
  </code></pre>
  
  <p><strong>SettingsFragment.java</strong></p>
  
  <pre><code>package com.example.yamba;
  
  import android.content.SharedPreferences;
  import android.os.Bundle;
  import android.preference.PreferenceFragment;
  import android.preference.PreferenceManager;
  
  /**
   * Created by me on 19-01-2015.
   */
  public class SettingsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
  
      private SharedPreferences prefs;
      @Override
      public void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
          addPreferencesFromResource(R.xml.settings);
      }
      public void onStart(){
          super.onStart();
          prefs= PreferenceManager.getDefaultSharedPreferences(getActivity());
          prefs.registerOnSharedPreferenceChangeListener(this);
      }
  
      @Override
      public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
  
      }
  }
  </code></pre>
  
  <p>I've stumbled upon suggestion that I may be able to define custom style based on one of the existing styles, but can't quite figure out how to approach it.</p>
  
  <p>If you need any other file, let me know and thanks for your time.</p>