Ensure inForeground is set before CMS binding can complete

This commit is contained in:
Cameron Gutman 2017-11-23 11:34:22 -08:00
parent f37ab40c2f
commit 300d444f71
2 changed files with 8 additions and 0 deletions

View File

@ -235,6 +235,10 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Assume we're in the foreground when created to avoid a race
// between binding to CMS and onResume()
inForeground = true;
shortcutHelper = new ShortcutHelper(this);
UiHelper.setLocale(this);

View File

@ -165,6 +165,10 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Assume we're in the foreground when created to avoid a race
// between binding to CMS and onResume()
inForeground = true;
// Create a GLSurfaceView to fetch GLRenderer unless we have
// a cached result already.
final GlPreferences glPrefs = GlPreferences.readPreferences(this);