2010-02-25 4 views

Répondre

2

Vous pouvez afficher une vue d'avancement de votre activité:

public class MyActivity extends Activity { 
    private static final int PROGRESS = 0x1; 

    private ProgressBar mProgress; 

    private Handler mHandler = new Handler(); 

    protected void onCreate(Bundle icicle) { 
     super.onCreate(icicle); 

     setContentView(R.layout.progressbar_activity); 

     mProgress = (ProgressBar) findViewById(R.id.progress_bar); 
     mProgress.setIndeterminate(true); 
     mProgress.setVisibility(true); 

     // Start lengthy operation in a background thread 
     new Thread(new Runnable() { 
      public void run() { 
       doWork(); 
       mProgress.setVisibility(false); 
      } 
     }).start(); 
    } 
} 

Voir ProgressBar documentation.

Questions connexes