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

java.lang.IllegalStateException: Fragment already added: CustomAlertDialogue{56e6968 #0 CustomAlertDialogue} #11

Open
devggaurav opened this issue Oct 4, 2018 · 2 comments

Comments

@devggaurav
Copy link

Every Time

@devggaurav
Copy link
Author

if (!isAdded()) {
FragmentManager fm = ((AppCompatActivity) activity).getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
Fragment prev = fm.findFragmentByTag(TAG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
show(((AppCompatActivity) activity).getSupportFragmentManager(), TAG);
return getDialog();
} else {
FragmentManager fm = ((AppCompatActivity) activity).getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
Fragment prev = fm.findFragmentByTag(TAG);
/if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
/
ft.show(prev);
//show(((AppCompatActivity) activity).getSupportFragmentManager(), TAG);
return getDialog();

    }

@rmdan90
Copy link

rmdan90 commented May 24, 2019

did you find a solution ??

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