Android - DialogFragment with Layout Containing Fragment -
i using customized dialogfragment. in oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) method, inflate layout contains fragment causing app crash. how can fix it?
you cannot nest fragments in other fragments xml-layouts. have add them code. insert fragment fragment have use special fragmentmanager - child fragmentmanager. can parent fragment:
//in dialogfragment ('parent') child fragmentmanager: fragmenttransaction transaction = getchildfragmentmanager().begintransaction(); transaction.transaction.add(new mycustomchildfragment(), "customtag"); i add child fragments in onactivitycreated().
Comments
Post a Comment