From 30227b9108760c860b1c7bb64f2583b5e19be14f Mon Sep 17 00:00:00 2001 From: Graham Jones Date: Mon, 25 Jul 2016 22:31:33 +0100 Subject: [PATCH] Added MainActivity menu option to view log files (via web interface). --- CHANGELOG.md | 1 + .../uk/org/openseizuredetector/MainActivity.java | 14 ++++++++++---- app/src/main/res/menu/main_activity_actions.xml | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24450c5..8c7d6c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ region of interest. - Fixed problem with log files not showing on web interface. - Added system log file to help with de-bugging start-up/shutdown issues. + - Added main activity menu option to view log files (via web browser). - Added options to switch off spectrum display on watch to save battery. - Reduced ammount of bluetooth comms to the watch to save battery. - Added support for future watch app features (such as raw mode and digital diff --git a/app/src/main/java/uk/org/openseizuredetector/MainActivity.java b/app/src/main/java/uk/org/openseizuredetector/MainActivity.java index 5dd5afa..69c8bb6 100644 --- a/app/src/main/java/uk/org/openseizuredetector/MainActivity.java +++ b/app/src/main/java/uk/org/openseizuredetector/MainActivity.java @@ -228,10 +228,16 @@ public class MainActivity extends Activity { case R.id.action_logs: Log.v(TAG, "action_logs"); try { - Intent prefsIntent = new Intent( - MainActivity.this, - LogManagerActivity.class); - this.startActivity(prefsIntent); + String url = "http://" + + mUtil.getLocalIpAddress() + + ":8080/logfiles.html"; + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse(url)); + startActivity(i); + //Intent prefsIntent = new Intent( + // MainActivity.this, + // LogManagerActivity.class); + //this.startActivity(prefsIntent); } catch (Exception ex) { Log.v(TAG, "exception starting log manager activity " + ex.toString()); } diff --git a/app/src/main/res/menu/main_activity_actions.xml b/app/src/main/res/menu/main_activity_actions.xml index c196140..9f74b14 100644 --- a/app/src/main/res/menu/main_activity_actions.xml +++ b/app/src/main/res/menu/main_activity_actions.xml @@ -51,8 +51,8 @@ android:id="@+id/action_logs" android:icon="@drawable/ic_action_settings" android:showAsAction="never|withText" - android:title="View/Edit Log Entries" - android:enabled="false" + android:title="View Log Entries" + android:enabled="true" />