2009-09-22 89 views

回答

2

使用ProgressDialog顯示進度主題負載數據處理器處理刷新UI

在onCreate上,

mProgressDlg = ProgressDialog.show(this, "App_Name", "Loading data...", 
        true, false); 
    new Thread(new Runnable(){ 
     public void run() { 
      /*Load Data*/ 
      mProgressDlg.dismiss(); 
      hRefresh.sendEmptyMessage(REFRESH); 
     } 
    }).start(); 



Handler hRefresh = new Handler(){ 

@Override 
public void handleMessage(Message msg) { 
     switch(msg.what){ 
     case REFRESH: 
       /*Refresh UI*/ 
       break; 
     } 
    } 
}; 
相關問題