aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-06-09 22:43:55 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-06-09 22:43:55 -0600
commit8ecb977629189f0bad5c223a7815ec4f323470d2 (patch)
tree60c0e9b62338703fa30c3f8cc3d68802efe49512 /app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
parent2abb9ca5578efa6e73d2bca8fdb7338752754ea7 (diff)
downloadwiimmfi-watcher-8ecb977629189f0bad5c223a7815ec4f323470d2.tar
wiimmfi-watcher-8ecb977629189f0bad5c223a7815ec4f323470d2.tar.gz
wiimmfi-watcher-8ecb977629189f0bad5c223a7815ec4f323470d2.tar.bz2
added new update checker, need to implement into ui
Diffstat (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java')
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
index ee68742..3a42749 100644
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
@@ -16,7 +16,6 @@ import me.brysonsteck.wiimmfiwatcher.fragments.WatchCodeFragment;
public class MainActivity extends AppCompatActivity {
AppDatabase database;
- @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -49,6 +48,26 @@ public class MainActivity extends AppCompatActivity {
});
}
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ new Thread(() -> {
+ Updater updater = new Updater();
+ updater.compareRelease(BuildConfig.VERSION_NAME);
+ if (updater.isOutdated()) {
+ System.out.println("---------------------------------------------------------------");
+ System.out.println("\tA newer version of Wiimmfi Watcher is available! (" + updater.getNewestRelease() + ")");
+ System.out.println("\tView the release notes and the source code here: " + updater.getGithubRelease());
+ System.out.println("\t---------------------------------------------------------------");
+ } else {
+ System.out.println("---------------------------------------------------------------");
+ System.out.println("\t\t" + updater.getNewestRelease() + " is the latest release of Wiimmfi Watcher.");
+ System.out.println("\t\t---------------------------------------------------------------");
+ }
+ }).start();
+ }
+
@Override
protected void onStop() {
super.onStop();