Cr Iagmge :https://www.youtube.com/watch?v=T5i70krfn74

[Android] Pass Object, ArrayList<ModelObject> from Activity or Fragment to Bundle

This is an example of passing Object, ArrayList as a bundle.

It is also possible to pass your custom object to other activities using the Bundle class.

There are two ways:

  • Serializable interface—for Java and Android
  • Parcelable interface—memory efficient, only for Android (recommended)

When using Intent, use it as follows.

Fragment can be used as below.

Java usage examples

Kotlin usage examloes code :

Code for the (Serializable) Item class.

(Parcelable) The code for the Item2 class.

Parcelable

Parcelable processing is much faster than serializable. One of the reasons for this is that we are being explicit about the serialization process instead of using reflection to infer it. It also stands to reason that the code has been heavily optimized for this purpose.

Java code of the sending part.

Java code of the receiving part.

Results screen Wow !!!

You have followed the group:

Please add Group :

Please add group

https://discord.gg/22mgfu

- Who does not answer questions, press delete all cases.
- Incomplete answers are also deleted.
- Accepting only people, not accepting pages
Impolite, illegal, erased and banned
- Account / Avatar account.
- No need to join a group. Catch, delete, only one location.
- Do not advertise for work Job .
- This group is sharing knowledge, not sharing nonsense.

- Thank you to member All.
- Thank you for the add later

Pm.
If you understand Please reply with If not, then you will be deleted.

//admin 😁😁😁

And

I created a group of Android Developers Android and Kotlin Droidcon Github library. If you have any questions, you can ask. You can join in the App Telegram. Now join Android Developers And Kotlin Droidcon

Android Developers And Kotlin Droidcon Github Library

Thank you for joining: https://www.facebook.com/groups/883546485084033/?fref=ts I created a group of Android Developers Android and Kotlin Droidcon Github library. If you have any questions, you can ask. You can join in the App Telegram. https://t.me/joinchat/IhB5KQ0aXC7ckNgjRaBaCw Now join Android Developers And Kotlin Droidcon Github Library Community Telegram App to help each other. Joining Link:

PongPloy Zone AppDev

Link : https://www.facebook.com/PPAndroid-Github-Dev-Zone-170227463027435/notifications/

--

--