I'm tried to blur background using this post: https://stackoverflow.com/a/21278278/10837992.
It's work good but i have a little problem with the size of the dialog.
I'm created custom layout :
I'm changed the realization of the method.
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = this.getLayoutInflater(); View dialogView = inflater.inflate(R.layout.alert_dialog_layout, null); builder.setView(dialogView); TextView title = dialogView.findViewById(R.id.Title); TextView desc = dialogView.findViewById(R.id.Desc); title.setText("Title"); desc.setText("Desc"); AlertDialog alert = builder.create(); Bitmap map = new BlurUtils().takeScreenShot(getActivity()); Bitmap fast = new BlurUtils().fastblur(map, 50); final Drawable drawable = new BitmapDrawable(getResources(), fast); alert.getWindow().setBackgroundDrawable(drawable); alert.show();
While running this method, the size of the Dialog is cropped: Screenshoot: