mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
Activity: catch exceptions while setting window background
This commit is contained in:
parent
b31dd386ac
commit
c17af62a19
1 changed files with 7 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue