Thursday, September 15, 2011

ProgressDialog on Starting a New Activity


@Override
public void onClick(View v) {
if(button1==v){

dialog = ProgressDialog.show(YellAdworksActivity.this, "!Loading",
        "Please wait for few seconds...", true);
new Thread(){
public void run(){
try{
startActivity(new Intent(YellAdworksActivity.this,SecondScreen.class)); 
}catch(Exception e){
 
}
dialog.dismiss();
}  
}.start();
 


//Toast.makeText(YellAdworksActivity.this, "You have clicked the First Button", Toast.LENGTH_SHORT).show();
}


ProgressDialog will be displayed when navigating from one activity to other..


Run as Android Application







No comments:

Post a Comment