Answers for "how to make blur background while dialog is show in android"

0

how to make popupwindow background blur in android

PopupWindow popup = new PopupWindow(contentView, width, height);
popup.setBackgroundDrawable(background);
popup.showAsDropDown(anchor);

View container = (View) popup.getContentView().getParent();
WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
WindowManager.LayoutParams p = (WindowManager.LayoutParams) container.getLayoutParams();
// add flag
p.flags |= WindowManager.LayoutParams.FLAG_DIM_BEHIND;
p.dimAmount = 0.3f;
wm.updateViewLayout(container, p);
Posted by: Guest on July-30-2021

Code answers related to "how to make blur background while dialog is show in android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language