简体   繁体   中英

Identify a view used in multiple activities

I have a spinner that i use over several activities. In one of them, I have to modify one of the parameters of the spinner. How could i identify from the spinner itself (without passing any extra parameter) the activities where the spinner will be inflated?

Depends a bit on your app - but I see 2 approaches for now:

1 You could add a tag to the spinner

2 You check the context of the spinner

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