Heads up! This post was written 11 years ago. Some information might be outdated or may have changed since then.
The one of the easiest ways to create custom styled Dialog in Android is to hide title and set xml layout in content. For example:
final Dialog dialog = new Dialog(MainActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialog_select_action_new);
dialog.show();
requestWindowFeature
method is need to be set before
setContentView
And in



    

    
file we have freedom to make any modifications, just like this:


    
    
        
        
    
    
    
        
        

Final result is:

ps: The big plus from that is on android 2.x devices dialog looks like android 4.x version.

Back to all posts