When moving an object to parcellable...

Asked 2 years ago, Updated 2 years ago, 22 views

The object was moved to parcelabel.

Suppose you moved an object from A to activity B, when you modified the object in activity B

Can I convert the value of the object declared in activity A??

I wonder what I should do if I can.

android

2022-09-21 21:33

1 Answers

In this case, it is a common pattern to run activity B from activity A to startActivityForResult() and return the result to activity A (as a Parcelable object).

Of course, this is not the only way. As an example, you can use the event bus to exchange data more conveniently.

These days, RxJava is a trend to replace event buses. If you are interested in this part, read the link below.


2022-09-21 21:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.