Here is my preference activity:
package com.example.hms.test;
import android.os.Bundle;
import android.preference.PreferenceActivity;
public class PrefsAct
You should do couple of things:
Add the following to your onCreate of PreferenceActivity:
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Override onOptionsItemSelected in PreferenceActivity:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId())
{
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
change the tag in manifest for your PreferenceActivity to look something like this:
Finally put android:launchMode="singleTop" in your MainActivity tag in manifest: