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}); TypedArray ta = obtainStyledAttributes(new int[] {R.attr.windowBackground});
Drawable background = ta.getDrawable(0); try {
if (background != null) Drawable background = ta.getDrawable(0);
window.setBackgroundDrawable(background); if (background != null)
window.setBackgroundDrawable(background);
} catch (Exception e) {
Slog.e(TAG, "Error setting window background", e);
}
ta.recycle(); ta.recycle();
return; return;