How to show Dialog in onCreate method?

you can use ProgressDialog Class with the Help of Handler Class. This way you can achieve what you want to do.

progDailog = ProgressDialog.show(loginAct,"Process ", "please wait....",true,true);

new Thread ( new Runnable()
{
     public void run()
     {
      // your loading code goes here
     }
}).start();


     Handler progressHandler = new Handler() 
     {

         public void handleMessage(Message msg1) 
         {

             progDailog.dismiss();
             }
     }

Leave a Comment