diff --git a/app/build.gradle b/app/build.gradle index 2d76b2d..9d42159 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "de.nsvb.android.auto.widget" minSdkVersion 21 targetSdkVersion 33 - versionCode 3 - versionName "0.2.1" + versionCode 4 + versionName "0.2.2" } ext { diff --git a/app/src/main/java/de/nsvb/android/auto/widget/AboutActivity.java b/app/src/main/java/de/nsvb/android/auto/widget/AboutActivity.java index 7b43326..7e35859 100644 --- a/app/src/main/java/de/nsvb/android/auto/widget/AboutActivity.java +++ b/app/src/main/java/de/nsvb/android/auto/widget/AboutActivity.java @@ -23,7 +23,7 @@ protected void onCreate(Bundle savedInstanceState) { "aauto-sdk-demo by martoreto
" + "https://github.com/martoreto/aauto-sdk-demo

" + "Widget Host Example by Leonardo Fischer
" + - "https://github.com/lgfischer/WidgetHostExample" + + "https://github.com/lgfischer/WidgetHostExample

" + "KISS by Neamar
" + "https://github.com/Neamar/KISS")); tv.setMovementMethod(LinkMovementMethod.getInstance()); diff --git a/app/src/main/java/de/nsvb/android/auto/widget/ConfigurationActivity.java b/app/src/main/java/de/nsvb/android/auto/widget/ConfigurationActivity.java index b68d5b7..c87a476 100644 --- a/app/src/main/java/de/nsvb/android/auto/widget/ConfigurationActivity.java +++ b/app/src/main/java/de/nsvb/android/auto/widget/ConfigurationActivity.java @@ -83,23 +83,23 @@ public void onClick(View view) { } @Override - protected void onResume() { - super.onResume(); - mAppWidgetHost.startListening(); - } - - @Override - protected void onPause() { - super.onPause(); - - mAppWidgetHost.stopListening(); + protected void onStart() { + super.onStart(); + try { + mAppWidgetHost.startListening(); + } catch (Exception e) { + Log.e(TAG, "couldn't start listening for widget updates:", e); + } } @Override protected void onStop() { super.onStop(); - - + try { + mAppWidgetHost.stopListening(); + } catch (Exception e) { + Log.w(TAG, "couldn't stop listening for widget updates:", e); + } } public void selectWidget() {