I am developing an application on the basis of two actions.
the first activity is called the second to get the download url.
The OnActivityResult function is the first Activity.there is a ProgressDialog which indicates the status of the image loading using this URL.
The problem is that the progress dialog is not displayed in this activity.
protected void onActivityResult(int requestCode, int resultCode, Intent imagePicked) { super.onActivityResult(requestCode, resultCode, imagePicked); if(resultCode==RESULT_OK) { ProgressDialog progressDialog=ProgressDialog.show(this, "", "Loading Image"); switch(requestCode) { case CharacterSelector.GetFaceBookImage: //Toast.makeText(this, "onFacebookimageresult", Toast.LENGTH_SHORT).show(); String ImageUrl=imagePicked.getStringExtra("DownloadLink"); WebService getImage=new WebService(ImageUrl); Log.d("Selected Img url", ""+ImageUrl); InputStream inputStream; try { inputStream = getImage.getHttpStream(ImageUrl); getImage=null; Bitmap bitmap=BitmapFactory.decodeStream(inputStream); inputStream=null; mybitmapDrawable=new BitmapDrawable(bitmap); addImageUserImage(mybitmapDrawable.mutate()); progressDialog.dismiss(); bitmap=null; } catch (IOException e) { //Show server Error message: e.printStackTrace(); } break;
Regards, Karyachan
source share