LayoutInflater: catch non critical exception in generateLayoutParams

This commit is contained in:
Julian Winkler
2024-09-03 17:52:35 +02:00
parent 14eae15178
commit 973225738b

View File

@@ -178,12 +178,16 @@ public class LayoutInflater {
Slog.v(TAG, "Creating params from root: " + root); Slog.v(TAG, "Creating params from root: " + root);
// Create layout params that match root, if supplied // Create layout params that match root, if supplied
params = root.generateLayoutParams(attrs); try {
params.resolveLayoutDirection(root.getLayoutDirection()); params = root.generateLayoutParams(attrs);
if (!attachToRoot) { params.resolveLayoutDirection(root.getLayoutDirection());
// Set the layout params for temp if we are not if (!attachToRoot) {
// attaching. (If we are, we use addView, below) // Set the layout params for temp if we are not
temp.setLayoutParams(params); // attaching. (If we are, we use addView, below)
temp.setLayoutParams(params);
}
} catch (RuntimeException e) {
Slog.w(TAG, "Exception in generateLayoutParams:", e);
} }
} }