android - FragmentTransaction 'add' not working -
i having problems adding fragment frame layout placeholder:
testdialogfragment newfragment = new testdialogfragment(); int id = r.id.fragment_placeholder; //id of framelayout placeholder testdialogfragment getfragmentmanager().begintransaction().add(id, newfragment, "testdialogfragment").commit();
i have breakpoints in onattach , oncreate methods in testdialogfragment , don't hit, goes against read in android fragment api guide. there i'm doing wrong add transaction above?
p.s. testdialogfragment extends fragment
i fixed setting & getting arguments bundles instead of interacting directly fragment via public methods after committing transaction. mistake assuming fragment , ready use (attached, layout inflated etc) commit() statement finished.
Comments
Post a Comment