鉴于uploadPhoto,我一直在努力弄清楚如何在UI线程上为这段代码获取ProgressDialog,并希望得到任何指导:
@Override
/** Handle Upload a Photo **/
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
// Get image
if (resultCode == RESULT_OK) {
// ProgressDialog dialog = ProgressDialog.show(this, "", "Uploading Photo...", true, false);
switch(requestCode) {
// Take Photo
case 4001:
// Upload
uploadPhoto(Uri.fromFile(mImageFile));
break;
// Select Photo
case 5001:
// Get image
Uri selectedImage = imageReturnedIntent.getData();
// Upload
uploadPhoto(selectedImage);
break;
}
// Dismiss
// dialog.dismiss();
}
}