diff --git a/DroidFishApp/src/main/java/org/petero/droidfish/DroidFishApp.java b/DroidFishApp/src/main/java/org/petero/droidfish/DroidFishApp.java index 490a3e7..ca4859d 100644 --- a/DroidFishApp/src/main/java/org/petero/droidfish/DroidFishApp.java +++ b/DroidFishApp/src/main/java/org/petero/droidfish/DroidFishApp.java @@ -34,9 +34,8 @@ public class DroidFishApp extends Application { private static Context appContext; private static Toast toast; - @Override - public void onCreate() { - super.onCreate(); + public DroidFishApp() { + super(); appContext = this; } @@ -96,10 +95,8 @@ public class DroidFishApp extends Application { toast.cancel(); toast = null; } - if (appContext != null) { - toast = Toast.makeText(appContext, resId, duration); - toast.show(); - } + toast = Toast.makeText(appContext, resId, duration); + toast.show(); } /** Show a toast after canceling current toast. */ @@ -108,9 +105,7 @@ public class DroidFishApp extends Application { toast.cancel(); toast = null; } - if (appContext != null) { - toast = Toast.makeText(appContext, text, duration); - toast.show(); - } + toast = Toast.makeText(appContext, text, duration); + toast.show(); } }