From 56304633f425b754cde7b18a846f66fd15d2c31a Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Sat, 28 Jul 2012 16:22:49 +0200 Subject: [PATCH] SettingsActivity: Add up navigation. --- .../org/yaaic/activity/SettingsActivity.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/application/src/org/yaaic/activity/SettingsActivity.java b/application/src/org/yaaic/activity/SettingsActivity.java index 071af16..1973856 100644 --- a/application/src/org/yaaic/activity/SettingsActivity.java +++ b/application/src/org/yaaic/activity/SettingsActivity.java @@ -24,7 +24,9 @@ import org.yaaic.R; import android.os.Bundle; +import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockPreferenceActivity; +import com.actionbarsherlock.view.MenuItem; /** * Settings @@ -41,6 +43,22 @@ public class SettingsActivity extends SherlockPreferenceActivity { super.onCreate(savedInstanceState); + ActionBar actionBar = getSupportActionBar(); + actionBar.setDisplayHomeAsUpEnabled(true); + addPreferencesFromResource(R.xml.preferences); } + + /** + * On menu item selected. + */ + @Override + public boolean onMenuItemSelected(int featureId, MenuItem item) + { + if (item.getItemId() == android.R.id.home) { + finish(); + } + + return true; + } }