0
我在android中擁有此代碼。但是,當螺紋乞討凍結加載。我如何防止凍結。這裏的代碼:Android加載對話框Freez
私人無效重裝(最後絃樂標準){ 嘗試{ myProgressDialog = ProgressDialog.show(myfiles.this, 「請稍候...」, 「載入您的相片...請稍候」 , false);
新的Thread(){ 公共無效的run(){ 嘗試{
Thread.sleep(2000);
} catch (Exception e) {
}
runOnUiThread(new Runnable() {
@Override
public void run() {
// Fetch the fact
try {
/* here my code */
} catch (Exception e) {
myProgressDialog.dismiss();
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
// Dismiss the Dialog
myProgressDialog.dismiss();
}
}。開始(); (例外e){TODO自動生成的catch塊 e.printStackTrace(); }
}