[英]Does Android always call back listeners in the same order they have been registered?
In my application I register several listeners to Preference changes via the registerOnSharedPreferenceChangeListener() function. 在我的应用程序中,我通过registerOnSharedPreferenceChangeListener()函数向Preference更改注册了多个侦听器。
This answer gave me a hint (listeners called in a single thread, sequential calling), and it seems rather obvious, but I could not find any confirmation of the calling order and my algorithm is dependent on the order. 这个答案给了我一个提示(侦听器在单线程中调用,顺序调用),这似乎很明显,但是我找不到调用顺序的任何确认,我的算法取决于该顺序。
Anyone can confirm? 任何人都可以确认吗?
调用顺序是无证的,因此您不应依赖它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.