From c170c693ec24c892b07fae617a95194dca492392 Mon Sep 17 00:00:00 2001 From: John Hsing Date: Sun, 5 Feb 2012 23:38:33 +0800 Subject: [PATCH 1/2] Set settings_page theme to Theme.Holo.Light In Android 4.x, recommended theme is Theme.Holo. do this just to keep consistent. Signed-off-by: John Hsing --- AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 149b48a..d57636a 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -134,7 +134,7 @@ android:name="net.micode.notes.ui.NotesPreferenceActivity" android:label="@string/preferences_title" android:launchMode="singleTop" - android:theme="@android:style/Theme.Light" > + android:theme="@android:style/Theme.Holo.Light" > Date: Mon, 6 Feb 2012 16:58:08 +0800 Subject: [PATCH 2/2] Use the app icon for navigation in settings_page Signed-off-by: John Hsing --- src/net/micode/notes/ui/NotesPreferenceActivity.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/net/micode/notes/ui/NotesPreferenceActivity.java b/src/net/micode/notes/ui/NotesPreferenceActivity.java index 2e7e5fd..07c5f7e 100644 --- a/src/net/micode/notes/ui/NotesPreferenceActivity.java +++ b/src/net/micode/notes/ui/NotesPreferenceActivity.java @@ -18,6 +18,7 @@ package net.micode.notes.ui; import android.accounts.Account; import android.accounts.AccountManager; +import android.app.ActionBar; import android.app.AlertDialog; import android.content.BroadcastReceiver; import android.content.ContentValues; @@ -34,6 +35,7 @@ import android.preference.PreferenceCategory; import android.text.TextUtils; import android.text.format.DateFormat; import android.view.LayoutInflater; +import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; @@ -70,6 +72,10 @@ public class NotesPreferenceActivity extends PreferenceActivity { @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); + + /* using the app icon for navigation */ + getActionBar().setDisplayHomeAsUpEnabled(true); + addPreferencesFromResource(R.xml.preferences); mAccountCategory = (PreferenceCategory) findPreference(PREFERENCE_SYNC_ACCOUNT_KEY); mReceiver = new GTaskReceiver(); @@ -371,7 +377,9 @@ public class NotesPreferenceActivity extends PreferenceActivity { public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: - finish(); + Intent intent = new Intent(this, NotesListActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); return true; default: return false;