How to send objects through bundle

前端 未结 11 1230
我寻月下人不归
我寻月下人不归 2020-11-27 13:15

I need to pass a reference to the class that does the majority of my processing through a bundle.

The problem is it has nothing to do with intents or contexts and ha

11条回答
  •  攒了一身酷
    2020-11-27 13:22

    another simple way to pass object using a bundle:

    • in the class object, create a static list or another data structure with a key
    • when you create the object, put it in the list/data structure with the key (es. the long timestamp when the object is created)
    • create the method static getObject(long key) to get the object from the list
    • in the bundle pass the key, so you can get the object later from another point in the code

提交回复
热议问题