Single Instance of Activity

后端 未结 2 1259
既然无缘
既然无缘 2020-12-11 05:19

My application has three activities say A -> B-> C.

Activity A is called from another activity through startActivityForResult(). Acti

2条回答
  •  爱一瞬间的悲伤
    2020-12-11 05:33

    You may be able to use a static variable to determine other data. I am not sure how much or what type of data you are looking to access from the other Activities, though.

    Also writing to persistent storage may work, but again - the vagueness of what data you are storing and how makes it difficult to answer. Just write/read the persistent storage in the onResume and onSuspend methdod of each Activity (or create super Activity class and extend it for A, B and C.

提交回复
热议问题