how to pass objects between intents

前端 未结 4 1888
暗喜
暗喜 2021-01-23 09:42

I have a class that contains data i want to pass it between intents, this class have arraylist that contains another class objects. this is my class

    public          


        
4条回答
  •  有刺的猬
    2021-01-23 09:57

    you can let your class Item implements the Serializable interface, and use Intent.putExtra(String, Serializable). Since ArrayList implements also the Serializable interface, you can pass the whole Items object.

提交回复
热议问题