Passing ArrayList between tabs

后端 未结 3 1626
没有蜡笔的小新
没有蜡笔的小新 2021-01-07 02:25

I\'m not very clear about the Intent object and how to use it to pass data between Activities. In my application I have several tabs between which I want to pass ArrayList.

3条回答
  •  清歌不尽
    2021-01-07 03:09

    I don't think altering the intent in onStop() will work because the TabHost handles the intents. Setting one class' intent with this.setIntent() wont let another class access it with getIntent() as they are built on different intents.

    I would either store my arrayPeople in a database or I would pass arrayPeople back to the TabHost with MyTabs.setArrayPeople or something similar. Then you can query the db onCreate of your next tab or just pull it from your MyTabs Class.

提交回复
热议问题