Reuse same framgent object in FragmentTransaction android -


i trying add fragment(b) inside fragment(a). , using code below.

fragment fragmentb = new fragmentb(); public void navigatetofragmentb(){  //adding data fragmentb. //fragmentb.addqueryparams();  fragmenttransaction fragmenttransaction = getchildfragmentmanager().begintransaction(); fragmenttransaction.replace(r.id.fragmentarootlayout, fragmentb); fragmenttransaction.commit(); } 

let's say, @ first, trying inflate fragmentb inside fragmenta queryparams queryparamold. it's working fine. now, problem arises when trying inflate fragmentb again different queryparams queryparamnew. it's not working. can me find out solution?

one possible solution move fragment fragmentb = new fragmentb() inside method(navigatetofragmentb()). but, don't want re-create object.


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -