From ad1138e5c5e298e04663ff6720db7ce05102b889 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 1 Jul 2014 13:52:59 +0200 Subject: [PATCH] Fixed ActionBar up button not working in all activities (ref #49). --- src/main/AndroidManifest.xml | 16 ++-------------- .../gui/FolderPickerActivity.java | 5 +++++ .../gui/NodeSettingsActivity.java | 3 +++ .../gui/RepoSettingsActivity.java | 3 +++ 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index f1072fbf..520fcb6c 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -47,25 +47,13 @@ - - + android:theme="@style/DialogWhenLarge" /> - - + android:theme="@style/DialogWhenLarge" /> - diff --git a/src/main/java/com/nutomic/syncthingandroid/gui/FolderPickerActivity.java b/src/main/java/com/nutomic/syncthingandroid/gui/FolderPickerActivity.java index c40166b6..083f7449 100644 --- a/src/main/java/com/nutomic/syncthingandroid/gui/FolderPickerActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/gui/FolderPickerActivity.java @@ -72,6 +72,8 @@ public class FolderPickerActivity extends ActionBarActivity protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + setContentView(R.layout.folder_picker_activity); mListView = (ListView) findViewById(android.R.id.list); mListView.setOnItemClickListener(this); @@ -126,6 +128,9 @@ public class FolderPickerActivity extends ActionBarActivity setResult(Activity.RESULT_OK, intent); finish(); return true; + case android.R.id.home: + finish(); + return true; default: return super.onOptionsItemSelected(item); } diff --git a/src/main/java/com/nutomic/syncthingandroid/gui/NodeSettingsActivity.java b/src/main/java/com/nutomic/syncthingandroid/gui/NodeSettingsActivity.java index aad97351..5c5e5c24 100644 --- a/src/main/java/com/nutomic/syncthingandroid/gui/NodeSettingsActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/gui/NodeSettingsActivity.java @@ -169,6 +169,9 @@ public class NodeSettingsActivity extends PreferenceActivity implements case R.id.share_node_id: RestApi.shareNodeId(this, mNode.NodeID); return true; + case android.R.id.home: + finish(); + return true; default: return super.onOptionsItemSelected(item); } diff --git a/src/main/java/com/nutomic/syncthingandroid/gui/RepoSettingsActivity.java b/src/main/java/com/nutomic/syncthingandroid/gui/RepoSettingsActivity.java index ed0ebd05..4da31208 100644 --- a/src/main/java/com/nutomic/syncthingandroid/gui/RepoSettingsActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/gui/RepoSettingsActivity.java @@ -200,6 +200,9 @@ public class RepoSettingsActivity extends PreferenceActivity mSyncthingService.getApi().editRepo(mRepo, true); finish(); return true; + case android.R.id.home: + finish(); + return true; } return super.onOptionsItemSelected(item); }