简体   繁体   中英

How to stay on current fragment after progressdialog dismiss android

Since we knew that progressdialog need a parameter context or get the activity of fragment but after dismissig the dialog it went to the other fragment which i set the the mainactivity default fragment is homepage

This is the method use in my class

 public void UploadProfilePicture(Context context, Uri imageUri){
      ProgressDialog prog = new ProgressDialog(context);
 }

This is strange behavior. If you are inside the Fragment and you want to initialize a Dialog just pass the context of the Fragement.

ProgressDialog prog = new ProgressDialog(requireContext());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM