How to open an alertDialog without darkening the screen?

1

I have this alertDialog:

private void createInfoWindow() {
    AlertDialog.Builder alert = new AlertDialog.Builder(activity);
    alert.setCancelable(true);
    alert.setView(R.layout.middle_window_adapter);
    alert.show();
}

How do I make the screen behind do not darken?

    
asked by anonymous 20.04.2017 / 16:42

1 answer

1

You can declare his background as transparent

For example:

AlertDialog.Builder alert = new AlertDialog.Builder(activity);
    alert.setCancelable(true);
    getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    alert.setView(R.layout.middle_window_adapter);
    alert.show();
    
20.04.2017 / 16:45