From e0ab8715762ef545a4d2bf47aa11ea5b282a7a71 Mon Sep 17 00:00:00 2001 From: Markus Ressel Date: Tue, 22 Mar 2016 00:27:41 +0100 Subject: [PATCH] codeVersion: 83 --- Smartphone/src/main/AndroidManifest.xml | 2 +- .../power_switch/gui/activity/MainActivity.java | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Smartphone/src/main/AndroidManifest.xml b/Smartphone/src/main/AndroidManifest.xml index a35b60c2..8ec6344c 100644 --- a/Smartphone/src/main/AndroidManifest.xml +++ b/Smartphone/src/main/AndroidManifest.xml @@ -21,7 +21,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="eu.power_switch" - android:versionCode="82" + android:versionCode="83" android:versionName="@string/app_version"> diff --git a/Smartphone/src/main/java/eu/power_switch/gui/activity/MainActivity.java b/Smartphone/src/main/java/eu/power_switch/gui/activity/MainActivity.java index 3ed955d8..35a68b86 100644 --- a/Smartphone/src/main/java/eu/power_switch/gui/activity/MainActivity.java +++ b/Smartphone/src/main/java/eu/power_switch/gui/activity/MainActivity.java @@ -251,14 +251,18 @@ public void onReceive(Context context, Intent intent) { @Override protected AsyncTaskResult doInBackground(Context... contexts) { - Context context = contexts[0]; - NetworkHandler.init(context); - List foundGateways = NetworkHandler.searchGateways(); + try { + Context context = contexts[0]; + NetworkHandler.init(context); + List foundGateways = NetworkHandler.searchGateways(); - Gateway[] gatewaysArray = new Gateway[foundGateways.size()]; - foundGateways.toArray(gatewaysArray); + Gateway[] gatewaysArray = new Gateway[foundGateways.size()]; + foundGateways.toArray(gatewaysArray); - return new AsyncTaskResult<>(gatewaysArray); + return new AsyncTaskResult<>(gatewaysArray); + } catch (Exception e) { + return new AsyncTaskResult<>(e); + } } @Override