Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't hide the Loading indicator View #131

Open
newbision opened this issue Jun 11, 2021 · 1 comment
Open

I can't hide the Loading indicator View #131

newbision opened this issue Jun 11, 2021 · 1 comment

Comments

@newbision
Copy link

Sometimes It does not hide when moving to the next fragment.

if (email.isEmpty()) {

        showProgress(); // I defined this function using AVLoadingIndicatorView in BaseActivity

        auth.signInWithEmailAndPassword(email, password)
                .addOnCompleteListener(getActivity(), task -> {

                    hideProgress(); // hide the AVLoadingIndicatorView

                    if (task.isSuccessful()) {
                        // Sign in success, update UI with the signed-in user's information
                        moveToSubjectSelectFragment();
                    } else {
                        Log.w(TAG, "createUserWithEmail:failure", task.getException());
                        Toast.makeText(getActivity(), "Login fail", Toast.LENGTH_SHORT).show();
                    }

            });
}

Here is the showProgress(), HideProgress() function in BaseActivity

public void showProgress() {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            if(activityIndicator != null) activityIndicator.show();
        }
    });
}

public void HideProgress() {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            if(activityIndicator != null) activityIndicator.hide();
        }
    });
}

@bipin-sakariya
Copy link

Same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants