문제

I am trying to show a progressbar dialogue while my

ParseUser.logInInBackground

checks the validity of user but I am unable to do so. Also I read that there is bug in parse that hinders doing so, can someone please tell me if that is possible and help me with the code, or should i just make a fake progress bar .

도움이 되었습니까?

해결책

I had faced a similar situation. What I ended up doing was the following.

private Dialog progressDialog;

define two methods to keep track of the progress bar showing or dismissing. Something like this.

public void showProgressBar(String msg){
   progressDialog = ProgressDialog.show(this, "", message, true);
}

public void dismissProgressBar(){
   if(progressDialog != null && progressDialog.isShowing())
         progressDialog.dismiss();
}

call showProgressBar(message) before login method.

showProgressBar(message); then, ParseUser.logInBackground. Then, Inside done method, call dismissProgressBar();

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top