I need to show a custom dialog in my Android application. Standard AlertDialog design is unacceptable. Android docs say:
Tip: If you want
Try...
You can avoid the gray background like this, Here I did get transparent background.
........
Dialog dialog = new Dialog(MainActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
Window window = dialog.getWindow();
window.setBackgroundDrawableResource(android.R.color.transparent);
dialog.setContentView(R.layout.popup_layout);
Button dialogBtn= (Button) dialog.findViewById(R.id.btn);
dialogBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//task
}
});
dialog.show();
.......