Android : showDialog not displayer inside onActivityResult after take photo
Posted
by Nicolas
on Stack Overflow
See other posts from Stack Overflow
or by Nicolas
Published on 2010-06-11T21:12:28Z
Indexed on
2010/06/11
21:23 UTC
Read the original article
Hit count: 450
Hello,
When i'm in onActivityResult and i try to show a custom progress dialog,
The dialog is not show, but the function is called, but nothing is displayed
If i put this dialog in Oncreate it's working i see the dialogbox,
Is it possible to show a custom dialog on return of Intent.ACTION_GET_CONTENT / MediaStore.ACTION_IMAGE_CAPTURE
Thanks
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Parseur UploadPhoto = new Parseur();
showDialog(PROGRESS_DIALOG);
if (requestCode == z_const.REQUEST_INTENT_CODE_PHOTO_CHOISIR) {
String selectedImagePath;
Uri selectedImageUri;
if (data != null){
selectedImageUri = data.getData();
selectedImagePath = getPath(selectedImageUri);
Log.e(TAG, "PHOTO CHOISIR " + selectedImagePath+"Res"+resultCode);
UploadPhoto.uploadPhoto(InfoPasse,selectedImagePath);
}
}
finish();
}
protected Dialog onCreateDialog(int id) {
Log.e(TAG," DIAL appeller "+id);
switch(id) {
case PROGRESS_DIALOG:
progressDialog = new ProgressDialog(Photo.this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setMessage("Loading...");
progressThread = new ProgressThread(handler);
progressThread.start();
return progressDialog;
default:
return null;
}
}
© Stack Overflow or respective owner