Fix NullPointerException introduced with the workaround

This commit is contained in:
Gabriel Calero 2018-06-01 15:48:57 -03:00
parent b2fe5a6d63
commit 459991988c

View file

@ -170,7 +170,9 @@ public class InterfaceActivity extends QtActivity {
private void surfacesWorkaround() { private void surfacesWorkaround() {
FrameLayout fl = findViewById(android.R.id.content); FrameLayout fl = findViewById(android.R.id.content);
if (fl.getChildCount() > 0) {
QtLayout qtLayout = (QtLayout) fl.getChildAt(0); QtLayout qtLayout = (QtLayout) fl.getChildAt(0);
if (qtLayout.getChildCount() > 1) {
QtSurface s1 = (QtSurface) qtLayout.getChildAt(0); QtSurface s1 = (QtSurface) qtLayout.getChildAt(0);
QtSurface s2 = (QtSurface) qtLayout.getChildAt(1); QtSurface s2 = (QtSurface) qtLayout.getChildAt(1);
Integer subLayer1 = 0; Integer subLayer1 = 0;
@ -191,6 +193,8 @@ public class InterfaceActivity extends QtActivity {
Log.e(TAG, "Workaround failed"); Log.e(TAG, "Workaround failed");
} }
} }
}
}
public void openUrlInAndroidWebView(String urlString) { public void openUrlInAndroidWebView(String urlString) {
Log.d("openUrl", "Received in open " + urlString); Log.d("openUrl", "Received in open " + urlString);