diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index fa4932240..063cfd5df 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -28,7 +28,11 @@
android:label="@string/title_activity_settings" />
+ android:label="App Manager">
+
+
+ android:label="@string/title_activity_debug">
+
+
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/AppManagerActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/AppManagerActivity.java
index dd476d7e3..a58cf08f3 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/AppManagerActivity.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/AppManagerActivity.java
@@ -6,6 +6,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
+import android.support.v4.app.NavUtils;
import android.support.v4.content.LocalBroadcastManager;
import android.view.ContextMenu;
import android.view.MenuItem;
@@ -54,6 +55,7 @@ public class AppManagerActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_appmanager);
+ getActionBar().setDisplayHomeAsUpEnabled(true);
appListView = (ListView) findViewById(R.id.appListView);
mGBDeviceAppAdapter = new GBDeviceAppAdapter(this, appList);
@@ -98,6 +100,16 @@ public class AppManagerActivity extends Activity {
}
}
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ NavUtils.navigateUpFromSameTask(this);
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
@Override
protected void onDestroy() {
LocalBroadcastManager.getInstance(this).unregisterReceiver(mReceiver);
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java
index cd4a4b5c2..e398727f1 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java
@@ -122,32 +122,28 @@ public class ControlCenter extends Activity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- // Handle action bar item clicks here. The action bar will
- // automatically handle clicks on the Home/Up button, so long
- // as you specify a parent activity in AndroidManifest.xml.
- int id = item.getItemId();
- //noinspection SimplifiableIfStatement
- if (id == R.id.action_settings) {
- Intent intent = new Intent(this, SettingsActivity.class);
- startActivity(intent);
- return true;
- } else if (id == R.id.action_debug) {
- Intent intent = new Intent(this, DebugActivity.class);
- startActivity(intent);
- return true;
- } else if (id == R.id.action_quit) {
- Intent stopIntent = new Intent(this, BluetoothCommunicationService.class);
- stopService(stopIntent);
+ switch (item.getItemId()) {
+ case R.id.action_settings:
+ Intent settingsIntent = new Intent(this, SettingsActivity.class);
+ startActivity(settingsIntent);
+ return true;
+ case R.id.action_debug:
+ Intent debugIntent = new Intent(this, DebugActivity.class);
+ startActivity(debugIntent);
+ return true;
+ case R.id.action_quit:
+ Intent stopIntent = new Intent(this, BluetoothCommunicationService.class);
+ stopService(stopIntent);
- Intent quitIntent = new Intent(ControlCenter.ACTION_QUIT);
- LocalBroadcastManager.getInstance(this).sendBroadcast(quitIntent);
- return true;
- } else if (id == R.id.action_refresh) {
- if (deviceList.isEmpty()) {
- refreshPairedDevices();
- mGBDeviceAdapter.notifyDataSetChanged();
- }
+ Intent quitIntent = new Intent(ControlCenter.ACTION_QUIT);
+ LocalBroadcastManager.getInstance(this).sendBroadcast(quitIntent);
+ return true;
+ case R.id.action_refresh:
+ if (deviceList.isEmpty()) {
+ refreshPairedDevices();
+ mGBDeviceAdapter.notifyDataSetChanged();
+ }
}
return super.onOptionsItemSelected(item);
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/DebugActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/DebugActivity.java
index 0e2ef3eec..84f70cae9 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/DebugActivity.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/DebugActivity.java
@@ -7,7 +7,9 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
+import android.support.v4.app.NavUtils;
import android.support.v4.app.NotificationCompat;
+import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
@@ -38,6 +40,7 @@ public class DebugActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_debug);
+ getActionBar().setDisplayHomeAsUpEnabled(true);
registerReceiver(mReceiver, new IntentFilter(ControlCenter.ACTION_QUIT));
@@ -153,6 +156,16 @@ public class DebugActivity extends Activity {
nManager.notify((int) System.currentTimeMillis(), ncomp.build());
}
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ NavUtils.navigateUpFromSameTask(this);
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
@Override
protected void onDestroy() {
super.onDestroy();