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

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

php - Calling a template part from a post -

How to mention the localhost in android -