janishar / android-mvp-architecture

This repository contains a detailed sample app that implements MVP architecture using Dagger2, GreenDao, RxJava2, FastAndroidNetworking and PlaceholderView

Home Page:https://janisharali.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

basedialog addition of fragments to backstack can be problematic

abhi472 opened this issue · comments

in basedialog where we are doing the fragment transaction, fragments are added to backstack
although it does seem harmless but in the cases where there is a repeated call to a same dialog(for eg. a network error dialog with retry option), same dialog is added to the backstack and even after transaction.remove() is applied the same dialog is reappearing.
By simply removing addtobackstack(null) we can save us from this problem,
anyhow i don't understand why do we need to retain a fragment after back press if we are handling removing similar dialogs anyway.
I solved my problem by removing addToBackStack(null)
i think this should also be applied in this repo too