tags:

views:

32

answers:

1

mycontext.startActivity(new Intent(mycontext, logoSplash.class)); //this finishis after 3 seconds

    initcontrols();

    final Timer timerStartAll = new Timer();
    timerStartAll.schedule(new TimerTask() {
    @Override  public void run() { 
    handler.post(new Runnable() { public void run() {
    timerStartAll.cancel();
    start();
    }});
    }
}, 4000, 5000);

function start:

utils.showLoaderDialog("refresh!", "refresh.");

in utils class:

public static ProgressDialog dialog;
public static void showLoaderDialog(String sHead, String sMess) {
dialog =ProgressDialog.show(myActivityStart.mycontext, sHead, sMess, true, true);
}
public static void hideLoaderDialog() {
dialog.dismiss();
}

why cant see the process dialog?

+1  A: 

Write this in onCreate method

    ProgressDialog pd = ProgressDialog.show(this, "", "Please Wait...", true, false);
    Thread th = new Thread(videoList);
    th.start();

And then add this functions

    public Runnable videoList = new Runnable() {

        public void run() {
                  //your code
                handler.sendEmptyMessage(0);
         }
     };

     private Handler handler = new Handler() {

      @Override
      public void handleMessage(Message msg) {

            if (pd != null)
            pd.dismiss();
      }
    };
krunal shah
worked thank u very much
lacas