Android Progress Dialog using runnable

Following code will create a progress dialog and run using ruunable interface.

final ProgressDialog dialog = ProgressDialog.show(Activity.this, 
           "Your Message", "Status Message",true);
 Handler handler = new Handler();

 Runnable runnable  = new Runnable() {
 
 @Override
 public void run() {
 startActivity(new Intent(MyActivity.this,
                        YourActivity.class));
 dialog.dismiss();
}
};
handler.postDelayed(runnable, 3000);

Comments

Post a Comment

Popular posts from this blog

Input filter (space not allowed) for EditText

Android Versions details

English - Formal and Informal words