Android Application Development (AND-401) — Question 48
What does the following code do?
dialog.getWindow().setFlags(LayoutParams.FLAG_BLUR_BEHIND,
LayoutParams.FLAG_BLUR_BEHIND);
Answer options
- A. When dialog is displayed the activity behind it will be blurred.
- B. When dialog is displayed the activity behind it will be dimmed.
- C. Any EditText behind the dialog will be disabled.
- D. When the dialog is displayed, the edges of the dialog will be blurred.
Correct answer: A
Explanation
The correct answer is A because the code sets the FLAG_BLUR_BEHIND, which causes the activity behind the dialog to appear blurred when the dialog is shown. Option B is incorrect as it refers to dimming, which is not what this flag does. Option C is not relevant to the code's functionality, and Option D inaccurately describes the visual effect, as it applies a blur to the entire background rather than just the edges of the dialog.