Handle back pressed of multiple fragments in android -


hi developing application using fragments.totally have 15 fragments , loaded in single activity.while onback pressing on each fragment launch previous fragment.i google , got answers it.but want know more efficient way handle this.

by calling addtobackstack(), replace transaction saved stack user can reverse transaction , bring previous fragment pressing button. reference

if add multiple changes transaction (such add() or remove()) , call addtobackstack(), changes applied before call commit() added stack single transaction , button reverse them together.

just add transaction.addtobackstack(null);

for more information may visit handling button press inside fragments


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -