You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
Activity: catch exceptions while setting window background
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user