Activity: catch exceptions while setting window background

This commit is contained in:
Julian Winkler 2025-02-10 17:56:45 +01:00
parent b31dd386ac
commit c17af62a19

View file

@ -179,9 +179,13 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
}
TypedArray ta = obtainStyledAttributes(new int[] {R.attr.windowBackground});
Drawable background = ta.getDrawable(0);
if (background != null)
window.setBackgroundDrawable(background);
try {
Drawable background = ta.getDrawable(0);
if (background != null)
window.setBackgroundDrawable(background);
} catch (Exception e) {
Slog.e(TAG, "Error setting window background", e);
}
ta.recycle();
return;