android - Open fragment from another fragment -
i´m building android application , trying default navigation android studio generates scratch.
how should open new fragment inside fragment?
replace fragment b fragment a:
fragmentmanager fragmentmanager = getactivity().getfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fragmenttransaction.replace(r.id.frame_layout_container, new fragmentb()); fragmenttransaction.addtobackstack(null); fragmenttransaction.commit();
done
Comments
Post a Comment