mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 06:10:28 +01:00
Initialize DroidFishApp.appContext earlier
This is an attempt to fix crashes reported in the play console.
This commit is contained in:
parent
7d87d1fbd4
commit
c4c650ce51
|
@ -34,9 +34,8 @@ public class DroidFishApp extends Application {
|
||||||
private static Context appContext;
|
private static Context appContext;
|
||||||
private static Toast toast;
|
private static Toast toast;
|
||||||
|
|
||||||
@Override
|
public DroidFishApp() {
|
||||||
public void onCreate() {
|
super();
|
||||||
super.onCreate();
|
|
||||||
appContext = this;
|
appContext = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,10 +95,8 @@ public class DroidFishApp extends Application {
|
||||||
toast.cancel();
|
toast.cancel();
|
||||||
toast = null;
|
toast = null;
|
||||||
}
|
}
|
||||||
if (appContext != null) {
|
toast = Toast.makeText(appContext, resId, duration);
|
||||||
toast = Toast.makeText(appContext, resId, duration);
|
toast.show();
|
||||||
toast.show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Show a toast after canceling current toast. */
|
/** Show a toast after canceling current toast. */
|
||||||
|
@ -108,9 +105,7 @@ public class DroidFishApp extends Application {
|
||||||
toast.cancel();
|
toast.cancel();
|
||||||
toast = null;
|
toast = null;
|
||||||
}
|
}
|
||||||
if (appContext != null) {
|
toast = Toast.makeText(appContext, text, duration);
|
||||||
toast = Toast.makeText(appContext, text, duration);
|
toast.show();
|
||||||
toast.show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user