简体   繁体   中英

Android passing objects between activities

Say if I have a locationManager(LM) object in activity A, which is my main menu. All the sub-activities need to use LM. In a good design, should I pass LM object to sub-activities? How? Please suggest some good coding pattern. Thanks.

当您有多个具有公共状态的活动时,您可以使用Application对象,即API为这些情况提出的建议

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM