Is it possible to combine two bundles into one before passing to a fragment on Android? So code snippet would be similar to :
Bundle b1 = SomeClass1.getSomeBundle();
Bundle b2 = SomeClass2.getDifferentBundle();
// How to do I pass these two bundles to a fragment?
fragment.setArgument(b1 + b2); // Illustrative only.
Is it possible to combine two bundles into one before passing to a fragment on Android?
Yes, you can do it using Bundle.putAll(Bundle bundle)
Or you can pass both bundles separately by creating a Bundle using Bundle.putBundle(String key, Bundle value)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With