diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index 6395f71398..7f0f40be0f 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -104,9 +104,6 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ m_androidPlatformNativeInterface = new QAndroidPlatformNativeInterface(); - if (!eglBindAPI(EGL_OPENGL_ES_API)) - qFatal("Could not bind GL_ES API"); - m_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (m_eglDisplay == EGL_NO_DISPLAY) qFatal("Could not open egl display"); @@ -115,6 +112,9 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ if (!eglInitialize(m_eglDisplay, &major, &minor)) qFatal("Could not initialize egl display"); + if (!eglBindAPI(EGL_OPENGL_ES_API)) + qFatal("Could not bind GL_ES API"); + m_primaryScreen = new QAndroidPlatformScreen(); screenAdded(m_primaryScreen); m_primaryScreen->setPhysicalSize(QSize(m_defaultPhysicalSizeWidth, m_defaultPhysicalSizeHeight));