diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 4837bb4..c91aa8d 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/build.gradle b/app/build.gradle index 7172d9e..e7cbdf6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,7 +22,7 @@ android { applicationId "com.tommasoberlose.anotherwidget" minSdkVersion 23 targetSdkVersion 29 - versionCode 86 + versionCode 87 versionName "2.0.8" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/release/app-release.aab b/app/release/app-release.aab index 5e31aba..e10a053 100644 Binary files a/app/release/app-release.aab and b/app/release/app-release.aab differ diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/ActivityDetectionReceiver.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/ActivityDetectionReceiver.kt index ea5e764..548ac2a 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/ActivityDetectionReceiver.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/ActivityDetectionReceiver.kt @@ -145,7 +145,13 @@ class ActivityDetectionReceiver : BroadcastReceiver() { .readData(readRequest) .addOnSuccessListener { response -> Preferences.googleFitSteps = response.buckets.sumBy { - it.getDataSet(DataType.AGGREGATE_STEP_COUNT_DELTA)?.dataPoints?.get(0)?.getValue(FIELD_STEPS)?.asInt() ?: 0 + try { + it.getDataSet(DataType.AGGREGATE_STEP_COUNT_DELTA)?.dataPoints?.get( + 0 + )?.getValue(FIELD_STEPS)?.asInt() ?: 0 + } catch (ex: Exception) { + 0 + } }.toLong() MainWidget.updateWidget(context) }