Skip to content Skip to sidebar Skip to footer

Create Progress Dialog With Another Layout

I want to create a progress dialog which inflates another XML file. So I tried the following code public class MyProgressDialog extends AlertDialog { public MyProgressDial

Solution 1:

Second parameter of super(context,R.layout.customprog) accepts a theme resource not a layout. Why don't you inflate the layout instead?

publicclassMyProgressDialogextendsAlertDialog 
{

       @Overridepublicvoidshow() {

        super.show();
        setContentView(R.layout.activity_main);
       }

}

Solution 2:

Instead of passing your custom layout in constructor, override onCreate() method of dialog and use setContentView() method to pass your custom layout..

Post a Comment for "Create Progress Dialog With Another Layout"