Q:

Android: App Icon as Up Button does not work

iam following the basic beginner Tutorial on the Android Developer Site. Now, i there is described how to bring the app icon as the Up Button (see last text): http://developer.android.com/training/basics/actionbar/adding-buttons.html#UpNav 
I put "getSupportActionBar().setDisplayHomeAsUpEnabled(true);" in my activitys onCreate() Methods, but on my Device my App has no App Icon as the Button. Here are my activities
public class MainActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

and
public class DisplayMessageActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    // Get the message from the intent
    Intent intent = this.getIntent();
    String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);

    // Create the text view
    TextView textView = new TextView(this);
    textView.setTextSize(40);
    textView.setText(message);

    // Set the text view as the activity layout
    setContentView(textView);
}

And also my Manifest
<?xml version="1.0" encoding="utf-8"?>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".DisplayMessageActivity"
        android:label="@string/title_activity_display_message"
        android:parentActivityName=".MainActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.example.andreas.myapplication.MainActivity" />
    </activity>
</application>

And Gradle Infos
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.example.andreas.myapplication"
    minSdkVersion 8
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}

iam confused because im alredy use the right method for minSdkVersion 8.
Does anyone know, why ma App does not show the Icon as Up-Button?
best Regards

A:

I have encountered the same problem - enabling "display home as up" led to the Up button with an arrow image on it. I have managed to replace arrow with an app icon with the following steps:

Create a new ImageAsset with app icon images in /drawable.
In OnCreate() of child activity, add 2 lines:
getSupportActionBar().setDisplayHomeAsUpEnabled(true);                    
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_action_home);

A:

Substitute meta-data value     android:value="com.example.andreas.myapplication.MainActivity"  for  android:value=".MainActivity"
To support older devices with the support library, also include a element that specifies the parent activity as the value for android.support.PARENT_ACTIVITY as shown below:
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
     android:name="android.support.PARENT_ACTIVITY"
     android:value=".MainActivity" />

A full explanation is here: http://programmerguru.com/android-tutorial/how-to-add-up-button-on-action-bar/

