Friday, 30 April 2021

What are the advantages of adding a fragment via XML vs programmatically?

From the Android documentation it's not very clear to me which are the advantages and practical use cases of adding fragments via XML compared to adding them programmatically.

Do both methods allow sending data from the activity to the fragment and back using Bundle?
Can both methods behave similarly in the activity lifecycle?

Some short examples or references will surely help.



from What are the advantages of adding a fragment via XML vs programmatically?

No comments:

Post a Comment