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

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -