8000 Merge pull request #869 from kivy/loading_screen · germn/python-for-android@3b937e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b937e9

Browse files
authored
Merge pull request kivy#869 from kivy/loading_screen
fix issue with loading_screen
2 parents 013bf29 + 96c9e29 commit 3b937e9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonActivity.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,15 @@ public void run() {
331331
});
332332
}
333333

334+
334335
protected void showLoadingScreen() {
335336
// load the bitmap
336337
// 1. if the image is valid and we don't have layout yet, assign this bitmap
337338
// as main view.
338339
// 2. if we have a layout, just set it in the layout.
339340
// 3. If we have an mImageView already, then do nothing because it will have
340341
// already been made the content view or added to the layout.
342+
341343
if (mImageView == null) {
342344
int presplashId = this.resourceManager.getIdentifier("presplash", "drawable");
343345
InputStream is = this.getResources().openRawResource(presplashId);
@@ -357,13 +359,14 @@ protected void showLoadingScreen() {
357359
ViewGroup.LayoutParams.FILL_PARENT));
358360
mImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
359361

360-
if (mLayout == null) {
361-
setContentView(mImageView);
362-
} else {
363-
mLayout.addView(mImageView);
364-
}
365-
}
366362
}
367363

364+
if (mLayout == null) {
365+
setContentView(mImageView);
366+
} else if (PythonActivity.mImageView.getParent() == null){
367+
mLayout.addView(mImageView);
368+
}
369+
370+
}
368371

369372
}

0 commit comments

Comments
 (0)
0